/* The chat box (Nov 17). One button bottom right, one panel. */

.kb-chat {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9990;
	font-family: var(--ma-font, "Work Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
	font-size: 15px;
	line-height: 1.45;
	color: #0a0a0a;
}

.kb-chat[hidden],
.kb-chat [hidden] {
	display: none !important;
}

.kb-chat__open {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	border: 0;
	border-radius: 6px;
	background: #ff2400;
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.kb-chat__open:hover,
.kb-chat__open:focus-visible {
	background: #d91f00;
}

.kb-chat__panel {
	display: flex;
	flex-direction: column;
	width: 400px;
	max-width: calc(100vw - 40px);
	height: 560px;
	max-height: calc(100vh - 40px);
	background: #fff;
	border: 1px solid #d9d9d9;
	border-radius: 8px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
	overflow: hidden;
}

.kb-chat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 12px 12px 16px;
	border-bottom: 3px solid #ff2400;
	background: #0a0a0a;
	color: #fff;
}

.kb-chat__head strong {
	font-size: 15px;
	font-weight: 600;
}

.kb-chat__tools {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.kb-chat__tool {
	padding: 6px 8px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: #fff;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}

.kb-chat__tool:hover,
.kb-chat__tool:focus-visible {
	background: rgba(255, 255, 255, 0.16);
}

.kb-chat__tool--x {
	display: inline-flex;
	padding: 6px;
}

.kb-chat__log {
	flex: 1 1 auto;
	padding: 16px;
	overflow-y: auto;
	background: #f6f6f6;
}

.kb-chat__msg {
	max-width: 92%;
	margin: 0 0 12px;
	padding: 10px 12px;
	border-radius: 8px;
	overflow-wrap: anywhere;
}

.kb-chat__msg--me {
	margin-left: auto;
	width: fit-content;
	background: #0a0a0a;
	color: #fff;
}

.kb-chat__msg--bot {
	background: #fff;
	border: 1px solid #e2e2e2;
}

.kb-chat__msg--wait::after {
	content: "...";
	display: inline-block;
	width: 1.2em;
	overflow: hidden;
	vertical-align: bottom;
	animation: kb-chat-dots 1.2s steps(4, end) infinite;
}

@keyframes kb-chat-dots {
	from { width: 0; }
	to { width: 1.2em; }
}

@media (prefers-reduced-motion: reduce) {
	.kb-chat__msg--wait::after {
		animation: none;
	}
}

.kb-chat__msg--error {
	border-color: #ff2400;
}

.kb-chat__text p,
.kb-chat__text ul,
.kb-chat__text ol {
	margin: 0 0 8px;
}

.kb-chat__text ul,
.kb-chat__text ol {
	padding-left: 20px;
}

.kb-chat__text > :last-child {
	margin-bottom: 0;
}

.kb-chat__sources {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #e2e2e2;
	font-size: 13px;
}

.kb-chat__sources-label {
	color: #5c5c5c;
}

.kb-chat__sources a {
	color: #0a0a0a;
	text-decoration: underline;
	text-decoration-color: #ff2400;
	text-underline-offset: 3px;
}

.kb-chat__sources a:hover,
.kb-chat__sources a:focus-visible {
	color: #ff2400;
}

.kb-chat__nolink {
	color: #5c5c5c;
}

.kb-chat__rate {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	font-size: 13px;
	color: #5c5c5c;
}

.kb-chat__ratebtn {
	padding: 2px 10px;
	border: 1px solid #c9c9c9;
	border-radius: 4px;
	background: #fff;
	color: #0a0a0a;
	font: inherit;
	cursor: pointer;
}

.kb-chat__ratebtn:hover,
.kb-chat__ratebtn:focus-visible {
	border-color: #0a0a0a;
}

.kb-chat__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid #e2e2e2;
	background: #fff;
}

.kb-chat__form textarea {
	flex: 1 1 auto;
	min-height: 44px;
	max-height: 120px;
	padding: 10px;
	border: 1px solid #c9c9c9;
	border-radius: 6px;
	background: #fff;
	color: #0a0a0a;
	font: inherit;
	resize: none;
}

.kb-chat__form textarea:focus {
	border-color: #0a0a0a;
	outline: 2px solid rgba(255, 36, 0, 0.35);
	outline-offset: 0;
}

.kb-chat__send {
	padding: 11px 16px;
	border: 0;
	border-radius: 6px;
	background: #ff2400;
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.kb-chat__send:hover,
.kb-chat__send:focus-visible {
	background: #d91f00;
}

.kb-chat__send:disabled {
	background: #b5b5b5;
	cursor: default;
}

.kb-chat__note {
	margin: 0;
	padding: 0 12px 10px;
	background: #fff;
	color: #5c5c5c;
	font-size: 12px;
}

.kb-chat .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

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

	.kb-chat__panel {
		position: fixed;
		inset: 0;
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		border: 0;
		border-radius: 0;
	}
}

@media print {
	.kb-chat {
		display: none;
	}
}

/* The Chat screen's table. */
.kb-chatlog__table td {
	vertical-align: top;
}

.kb-chatlog__table td:nth-child(3) {
	min-width: 180px;
}

.kb-chatlog__table td:nth-child(4) {
	min-width: 320px;
}

/* One rating for the whole chat. */
.kb-chat__stars { display: flex; align-items: center; gap: 4px; padding: 8px 14px; border-top: 1px solid #e3e5e7; font-size: 13px; color: #5d5f61; }
.kb-chat__stars[hidden] { display: none; }
.kb-chat__stars span { margin-right: 6px; }
.kb-chat__star { padding: 0 2px; border: 0; background: none; font-size: 20px; line-height: 1; color: #c9ccce; cursor: pointer; }
.kb-chat__star.is-on, .kb-chat__star:hover { color: #ff2400; }

.kb-chat__stars { flex-wrap: wrap; }
.kb-chat__stars.is-done { color: #17512a; }
.kb-chat__more { display: flex; gap: 8px; align-items: flex-end; flex: 1 1 100%; margin-top: 6px; }
.kb-chat__more[hidden] { display: none; }
.kb-chat__fb { flex: 1 1 auto; min-width: 0; padding: 6px 8px; border: 1px solid #babec1; border-radius: 4px; font: inherit; resize: vertical; }
.kb-chat__submit { padding: 7px 14px; border: 1px solid #111; border-radius: 4px; background: #111; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }

/* Nov 21, simpler box: one rating line, a one-line question box the height of Send, no line under it. */
.kb-chat__form { align-items: flex-end; }
.kb-chat__form textarea { box-sizing: border-box; height: 42px; min-height: 42px; padding: 9px 10px; line-height: 22px; overflow-y: auto; }
.kb-chat__send { box-sizing: border-box; height: 42px; padding: 0 16px; }
.kb-chat__stars { flex-wrap: nowrap; gap: 2px; padding: 8px 12px; }
.kb-chat__stars span[hidden] { display: none; }
.kb-chat__more { flex: 1 1 auto; min-width: 0; align-items: center; gap: 6px; margin: 0 0 0 8px; }
.kb-chat__fb { box-sizing: border-box; height: 32px; padding: 0 8px; border-radius: 6px; }
.kb-chat__submit { box-sizing: border-box; height: 32px; padding: 0 12px; border-radius: 6px; flex: 0 0 auto; }

/* Sources under an answer: one small line of red links. */
.kb-chat__sources { display: block; margin-top: 8px; padding-top: 8px; font-size: 12px; line-height: 1.4; color: #5c5c5c; }
.kb-chat__sources a { color: #ff2400; text-decoration: none; }
.kb-chat__sources a:hover, .kb-chat__sources a:focus-visible { color: #ff2400; text-decoration: underline; }
