/* =========================================================
   USCON — chat widget
   Bottom-right launcher + panel, mirroring cookie-consent.css's
   bottom-left popup. Same tokens, same zero-radius rule — load-bearing
   across the whole site, so nothing here gets a border-radius either.
   ========================================================= */

/* ---------------------------------------------------------
   Launcher button
   --------------------------------------------------------- */
.chat-launcher {
	position: fixed;
	right: var(--s-24);
	bottom: var(--s-24);
	z-index: 290;
	display: flex;
	align-items: center;
	gap: var(--s-8);
	box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
.chat-launcher svg { width: 20px; height: 20px; display: block; flex: 0 0 auto; }

@media (max-width: 420px) {
	.chat-launcher { right: var(--s-16); bottom: var(--s-16); padding: 12px var(--s-16); }
	.chat-launcher span { display: none; }
}

/* ---------------------------------------------------------
   Panel
   --------------------------------------------------------- */
.chat-panel {
	position: fixed;
	right: var(--s-24);
	bottom: calc(var(--s-24) + 64px);
	z-index: 290;
	width: 360px;
	max-width: calc(100vw - (var(--s-24) * 2));
	max-height: min(560px, calc(100vh - 140px));
	display: none;
	flex-direction: column;
	background: var(--soot);
	border: 1px solid var(--smoke-line);
	box-shadow: 0 20px 48px rgba(0, 0, 0, .45);
}
.chat-panel.is-open { display: flex; }

@media (max-width: 420px) {
	.chat-panel {
		right: var(--s-16);
		bottom: calc(var(--s-16) + 56px);
		width: calc(100vw - (var(--s-16) * 2));
	}
}

.chat-panel__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--s-16);
	padding: var(--s-16) var(--s-24);
	border-bottom: 1px solid var(--smoke-line);
	background: var(--ash);
	flex: 0 0 auto;
}
.chat-panel__head strong {
	display: block;
	font-family: var(--display);
	font-size: var(--t-16);
	color: var(--bone);
}
.chat-panel__sub {
	display: block;
	font-size: var(--t-14);
	color: var(--haze);
	margin-top: 2px;
}
.chat-panel__close {
	width: 28px;
	height: 28px;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	color: var(--haze);
	cursor: pointer;
	padding: 0;
}
.chat-panel__close:hover { color: var(--bone); }
.chat-panel__close svg { width: 14px; height: 14px; display: block; }

.chat-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: var(--s-16) var(--s-24);
	display: flex;
	flex-direction: column;
	gap: var(--s-8);
	min-height: 160px;
}

.chat-msg {
	max-width: 85%;
	padding: 10px var(--s-16);
	font-size: var(--t-14);
	line-height: 1.5;
	border: 1px solid var(--smoke-line);
	white-space: pre-wrap;
	word-break: break-word;
}
.chat-msg--bot {
	align-self: flex-start;
	background: var(--ash);
	color: var(--bone);
}
.chat-msg--user {
	align-self: flex-end;
	background: var(--ember);
	color: var(--btn-label);
	border-color: var(--ember);
}

.chat-chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-8);
	padding: 0 var(--s-24) var(--s-16);
	flex: 0 0 auto;
}
.chat-chip {
	font-family: var(--body);
	font-size: var(--t-14);
	background: transparent;
	color: var(--haze);
	border: 1px solid var(--smoke-line);
	padding: 6px var(--s-16);
	cursor: pointer;
}
.chat-chip:hover { border-color: var(--ember); color: var(--ember-light); }

.chat-form {
	display: flex;
	gap: var(--s-8);
	padding: var(--s-16) var(--s-24);
	border-top: 1px solid var(--smoke-line);
	flex: 0 0 auto;
}
.chat-input {
	flex: 1 1 auto;
	background: var(--ash);
	border: 1px solid var(--smoke-line);
	color: var(--bone);
	font-family: var(--body);
	font-size: var(--t-16);
	padding: 10px var(--s-16);
	min-width: 0;
}
.chat-input::placeholder { color: var(--haze-deep); }

.chat-send {
	flex: 0 0 auto;
	width: 44px;
	background: var(--ember);
	color: var(--btn-label);
	border: 1px solid var(--ember);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color .18s ease;
}
.chat-send:hover { background: var(--ember-light); }
.chat-send svg { width: 18px; height: 18px; display: block; }

.chat-panel__foot {
	font-size: 12px;
	color: var(--haze-deep);
	padding: 0 var(--s-24) var(--s-16);
	margin: 0;
	flex: 0 0 auto;
}

@media (prefers-reduced-motion: reduce) {
	.chat-launcher, .chat-panel { transition: none; }
}
