/*
 * The chat on cmmc.live (Core 0.3.198, D157): the button at the bottom right of every page of Main's own website,
 * and the chat it opens, in the website's navy and teal (content/website/clw.css). Main's theme styles buttons,
 * headings, links and boxes everywhere, so each part here says its own size, colour and spacing.
 */
.cmmc-pchat {
	--pc-navy: #0f2747;
	--pc-deep: #0b1d36;
	--pc-teal: #0a6f6d;
	--pc-teal-dark: #085856;
	--pc-mint: #7fe0d8;
	--pc-wash: #f4f7fb;
	--pc-line: #e3e9f1;
	--pc-text: #33435e;
	--pc-muted: #5f6d86;
	--pc-ink: #0f1e36;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--pc-text);
}

.cmmc-pchat *,
.cmmc-pchat *::before,
.cmmc-pchat *::after {
	box-sizing: border-box;
}

.cmmc-pchat [hidden] {
	display: none !important;
}

.cmmc-pchat svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex: none;
}

.cmmc-pchat .cmmc-pchat__sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* The button. */
.cmmc-pchat .cmmc-pchat__open {
	position: fixed;
	right: 20px;
	bottom: calc(20px + env(safe-area-inset-bottom, 0px));
	z-index: 100050;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 52px;
	margin: 0;
	padding: 0 20px 0 16px;
	border: 0;
	border-radius: 999px;
	background: var(--pc-teal);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
	box-shadow: 0 12px 28px -10px rgba(10, 111, 109, 0.75), 0 2px 6px rgba(15, 30, 54, 0.18);
	cursor: pointer;
	transition: background 0.15s, transform 0.15s;
}

.cmmc-pchat .cmmc-pchat__open:hover {
	background: var(--pc-teal-dark);
	transform: translateY(-1px);
}

.cmmc-pchat .cmmc-pchat__open:focus-visible,
.cmmc-pchat button:focus-visible,
.cmmc-pchat a:focus-visible,
.cmmc-pchat .cmmc-pchat__box:focus-visible {
	outline: 3px solid var(--pc-mint);
	outline-offset: 2px;
}

.cmmc-pchat.is-open .cmmc-pchat__open {
	display: none;
}

/* The window. */
.cmmc-pchat .cmmc-pchat__panel {
	position: fixed;
	right: 20px;
	bottom: calc(20px + env(safe-area-inset-bottom, 0px));
	z-index: 100051;
	display: flex;
	flex-direction: column;
	width: 400px;
	max-width: calc(100vw - 32px);
	height: min(640px, calc(100vh - 40px));
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--pc-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 24px 60px -20px rgba(11, 29, 54, 0.45), 0 4px 14px rgba(11, 29, 54, 0.12);
}

.cmmc-pchat .cmmc-pchat__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 12px 14px 16px;
	background: radial-gradient(420px 160px at 100% -40%, rgba(44, 194, 187, 0.35), transparent 70%), var(--pc-deep);
	color: #fff;
}

.cmmc-pchat .cmmc-pchat__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: rgba(127, 224, 216, 0.14);
	color: var(--pc-mint);
	flex: none;
}

.cmmc-pchat .cmmc-pchat__titles {
	flex: 1;
	min-width: 0;
}

.cmmc-pchat .cmmc-pchat__title,
.cmmc-pchat .cmmc-pchat__sub {
	margin: 0 !important;
	padding: 0;
}

.cmmc-pchat .cmmc-pchat__title {
	color: #fff !important;
	font-size: 16px !important;
	font-weight: 800;
	line-height: 1.25 !important;
	letter-spacing: -0.01em;
}

.cmmc-pchat .cmmc-pchat__sub {
	color: #c5d3e8 !important;
	font-size: 12.5px !important;
	line-height: 1.35 !important;
}

.cmmc-pchat .cmmc-pchat__restart,
.cmmc-pchat .cmmc-pchat__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 34px;
	margin: 0;
	border: 1px solid transparent;
	border-radius: 8px;
	background: transparent;
	color: #dce6f3;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
	flex: none;
}

.cmmc-pchat .cmmc-pchat__restart {
	padding: 0 10px;
	border-color: rgba(255, 255, 255, 0.22);
}

.cmmc-pchat .cmmc-pchat__close {
	width: 34px;
	padding: 0;
}

.cmmc-pchat .cmmc-pchat__restart:hover,
.cmmc-pchat .cmmc-pchat__close:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.cmmc-pchat .cmmc-pchat__trying {
	margin: 0 !important;
	padding: 8px 16px;
	background: #fff6e0;
	border-bottom: 1px solid #f1dfae;
	color: #6b4e00 !important;
	font-size: 13px !important;
	line-height: 1.4 !important;
}

.cmmc-pchat .cmmc-pchat__log {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	background: var(--pc-wash);
}

.cmmc-pchat .cmmc-pchat__msg {
	max-width: 88%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14.5px;
	line-height: 1.55;
	overflow-wrap: anywhere;
}

.cmmc-pchat .cmmc-pchat__msg p {
	margin: 0 0 8px !important;
	padding: 0;
	color: inherit !important;
	font-size: inherit !important;
	line-height: inherit !important;
}

.cmmc-pchat .cmmc-pchat__msg p:last-child {
	margin-bottom: 0 !important;
}

.cmmc-pchat .cmmc-pchat__msg--bot {
	align-self: flex-start;
	border: 1px solid var(--pc-line);
	border-top-left-radius: 4px;
	background: #fff;
	color: var(--pc-ink);
}

.cmmc-pchat .cmmc-pchat__msg--me {
	align-self: flex-end;
	border-top-right-radius: 4px;
	background: var(--pc-navy);
	color: #fff;
}

.cmmc-pchat .cmmc-pchat__msg--note {
	border-color: #f1dfae;
	background: #fffaf0;
}

.cmmc-pchat .cmmc-pchat__msg .cmmc-pchat__sources {
	margin-top: 10px !important;
	padding-top: 8px;
	border-top: 1px solid var(--pc-line);
	color: var(--pc-muted) !important;
	font-size: 12.5px !important;
	line-height: 1.45 !important;
}

.cmmc-pchat a.cmmc-pchat__go {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	padding: 8px 14px;
	border-radius: 999px;
	background: var(--pc-teal);
	color: #fff !important;
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
}

.cmmc-pchat a.cmmc-pchat__go::after {
	content: "\2192";
	color: #fff !important;
}

.cmmc-pchat a.cmmc-pchat__go:hover {
	background: var(--pc-teal-dark);
}

.cmmc-pchat .cmmc-pchat__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.cmmc-pchat .cmmc-pchat__chip {
	margin: 0;
	padding: 8px 12px;
	border: 1px solid rgba(10, 111, 109, 0.35);
	border-radius: 999px;
	background: #fff;
	color: var(--pc-teal);
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.25;
	text-align: left;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
}

.cmmc-pchat .cmmc-pchat__chip:hover {
	border-color: var(--pc-teal);
	background: #eef8f7;
}

.cmmc-pchat .cmmc-pchat__wait {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 14px 16px;
}

.cmmc-pchat .cmmc-pchat__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--pc-teal);
	opacity: 0.35;
	animation: cmmc-pchat-dot 1.2s infinite ease-in-out;
}

.cmmc-pchat .cmmc-pchat__dot:nth-child(2) {
	animation-delay: 0.15s;
}

.cmmc-pchat .cmmc-pchat__dot:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes cmmc-pchat-dot {
	0%, 80%, 100% {
		opacity: 0.35;
		transform: translateY(0);
	}

	40% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cmmc-pchat .cmmc-pchat__dot {
		animation: none;
	}

	.cmmc-pchat .cmmc-pchat__open {
		transition: none;
	}
}

/* Asking. */
.cmmc-pchat .cmmc-pchat__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin: 0;
	padding: 12px;
	border-top: 1px solid var(--pc-line);
	background: #fff;
}

.cmmc-pchat .cmmc-pchat__box {
	flex: 1;
	min-width: 0;
	height: 44px;
	min-height: 44px;
	max-height: 120px;
	margin: 0;
	padding: 11px 12px;
	border: 1px solid #c9d4e2 !important;
	border-radius: 10px !important;
	background: #fff !important;
	color: var(--pc-ink) !important;
	font: inherit !important;
	font-size: 15px !important;
	line-height: 1.4 !important;
	resize: none;
	overflow-y: hidden;
	box-shadow: none !important;
}

.cmmc-pchat .cmmc-pchat__box:focus {
	border-color: var(--pc-teal) !important;
}

.cmmc-pchat .cmmc-pchat__trap {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
}

.cmmc-pchat .cmmc-pchat__send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: var(--pc-teal);
	color: #fff;
	box-shadow: none;
	cursor: pointer;
	flex: none;
}

.cmmc-pchat .cmmc-pchat__send:hover {
	background: var(--pc-teal-dark);
}

.cmmc-pchat .cmmc-pchat__send:disabled {
	opacity: 0.55;
	cursor: wait;
}

.cmmc-pchat .cmmc-pchat__foot {
	margin: 0 !important;
	padding: 0 14px 12px;
	background: #fff;
	color: var(--pc-muted) !important;
	font-size: 11.5px !important;
	line-height: 1.4 !important;
}

.cmmc-pchat .cmmc-pchat__foot a {
	color: var(--pc-teal) !important;
	font-weight: 600;
	text-decoration: underline;
}

/* The theme's own button back to the top steps up, out of the chat's way. */
body.cmmc-pchat-on .to-top-container #toTop {
	bottom: 84px !important;
}

/* A phone: the button keeps to the corner; the chat fills the screen. */
@media (max-width: 640px) {
	.cmmc-pchat .cmmc-pchat__open {
		right: 16px;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		height: 48px;
		padding: 0 16px 0 14px;
		font-size: 14px;
	}

	.cmmc-pchat .cmmc-pchat__panel {
		inset: 0;
		width: 100%;
		max-width: none;
		height: 100%;
		border: 0;
		border-radius: 0;
		padding-top: env(safe-area-inset-top, 0px);
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}

	.cmmc-pchat .cmmc-pchat__msg {
		max-width: 92%;
	}

	body.cmmc-pchat-on .to-top-container #toTop {
		bottom: 76px !important;
	}
}
