/* Colours fall back to the live Midland Skin palette if the theme variables are missing. */
.mkb-launcher,
.mkb-panel {
	--mkb-navy: var(--global-palette7, #123659);
	--mkb-gold: var(--global-palette1, #a78854);
	--mkb-cream: var(--global-palette2, #f4f1ea);
	--mkb-ink: var(--global-palette3, #040c14);
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 99990;
	font-family: inherit;
	box-sizing: border-box;
}

.mkb-panel *,
.mkb-panel *::before,
.mkb-panel *::after {
	box-sizing: border-box;
}

.mkb-launcher[hidden],
.mkb-panel[hidden] {
	display: none;
}

.mkb-launcher {
	padding: 12px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--mkb-navy);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(4, 12, 20, 0.25);
}

.mkb-launcher:hover,
.mkb-launcher:focus-visible {
	background: var(--mkb-gold);
}

.mkb-panel {
	display: flex;
	flex-direction: column;
	width: min(380px, calc(100vw - 32px));
	height: min(600px, calc(100dvh - 32px));
	border-radius: 12px;
	background: #fff;
	color: var(--mkb-ink);
	font-size: 15px;
	line-height: 1.5;
	box-shadow: 0 8px 32px rgba(4, 12, 20, 0.3);
	overflow: hidden;
}

.mkb-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: var(--mkb-navy);
	color: #fff;
}

.mkb-close {
	border: 0;
	background: none;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.mkb-log {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.mkb-msg {
	max-width: 88%;
	padding: 10px 12px;
	border-radius: 10px;
	overflow-wrap: anywhere;
}

.mkb-user {
	align-self: flex-end;
	background: var(--mkb-navy);
	color: #fff;
	white-space: pre-wrap;
}

.mkb-assistant {
	align-self: flex-start;
	background: var(--mkb-cream);
}

.mkb-assistant p,
.mkb-assistant ul {
	margin: 0 0 8px;
}

.mkb-assistant ul {
	padding-left: 18px;
}

.mkb-assistant > :last-child {
	margin-bottom: 0;
}

.mkb-assistant a {
	color: var(--mkb-navy);
	text-decoration: underline;
}

.mkb-notice {
	margin: 0;
	padding: 8px 16px;
	border-top: 1px solid #e3e0d8;
	background: #fbfaf7;
	color: #4a4f55;
	font-size: 12px;
	line-height: 1.4;
}

.mkb-notice a {
	color: inherit;
	text-decoration: underline;
}

.mkb-form {
	display: flex;
	gap: 8px;
	padding: 10px 12px 12px;
	background: #fbfaf7;
}

.mkb-input {
	flex: 1;
	min-width: 0;
	padding: 8px 10px;
	border: 1px solid #c9c5ba;
	border-radius: 8px;
	background: #fff;
	color: var(--mkb-ink);
	font: inherit;
	font-size: 16px; /* 16px stops iOS zooming the page on focus */
	resize: none;
}

.mkb-send {
	align-self: flex-end;
	padding: 9px 14px;
	border: 0;
	border-radius: 8px;
	background: var(--mkb-navy);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.mkb-send:disabled {
	opacity: 0.5;
	cursor: default;
}

.mkb-launcher:focus-visible,
.mkb-close:focus-visible,
.mkb-send:focus-visible,
.mkb-input:focus-visible {
	outline: 3px solid var(--mkb-gold);
	outline-offset: 2px;
}
