/* USCS — chat widget: bottom-right launcher + panel.
   Uses the tokens defined in main.css. */

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

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

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

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

.chat-panel__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 24px;
	border-bottom: 1px solid var(--line);
	background: var(--cloud);
	flex: 0 0 auto;
}
.chat-panel__head strong {
	display: block;
	font-family: var(--font-display);
	font-size: 1rem;
	color: var(--graphite);
}
.chat-panel__sub {
	display: block;
	font-size: .875rem;
	color: var(--slate);
	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(--slate);
	cursor: pointer;
	padding: 0;
}
.chat-panel__close:hover { color: var(--graphite); }
.chat-panel__close svg { width: 14px; height: 14px; display: block; }

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

.chat-msg {
	max-width: 85%;
	padding: 10px 16px;
	font-size: .875rem;
	line-height: 1.5;
	border: 1px solid var(--line);
	white-space: pre-wrap;
	word-break: break-word;
}
.chat-msg--bot {
	align-self: flex-start;
	background: var(--cloud);
	color: var(--graphite);
}
.chat-msg--user {
	align-self: flex-end;
	background: var(--blue);
	color: var(--on-accent);
	border-color: var(--ink);
}

.chat-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 24px 16px;
	flex: 0 0 auto;
}
.chat-chip {
	font-family: var(--font-body);
	font-size: .875rem;
	background: transparent;
	color: var(--slate);
	border: 1px solid var(--line);
	padding: 6px 16px;
	cursor: pointer;
}
.chat-chip:hover { border-color: var(--ink); color: var(--ink); }

.chat-form {
	display: flex;
	gap: 8px;
	padding: 16px 24px;
	border-top: 1px solid var(--line);
	flex: 0 0 auto;
}
.chat-input {
	flex: 1 1 auto;
	background: var(--cloud);
	border: 1px solid var(--line);
	color: var(--graphite);
	font-family: var(--font-body);
	font-size: 1rem;
	padding: 10px 16px;
	min-width: 0;
}
.chat-input::placeholder { color: var(--slate); }

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

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

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

/* Rounded corners to match the site's components */
.chat-panel { border-radius: 12px; overflow: hidden; }
.chat-launcher { border-radius: 999px; }
.chat-msg { border-radius: 12px; }
.chat-msg--bot { border-bottom-left-radius: 4px; }
.chat-msg--user { border-bottom-right-radius: 4px; }
.chat-chip { border-radius: 999px; }
.chat-input, .chat-send { border-radius: 10px; }
.chat-panel__close { border-radius: 8px; }
.chat-panel__head strong { color: var(--navy-900); }