/* AI Concierge — front-end widget (P3b) */

#mphbai-root {
	--mphbai-primary: #2563eb;
	--mphbai-bg: #ffffff;
	--mphbai-fg: #1f2937;
	--mphbai-muted: #6b7280;
	--mphbai-border: #e5e7eb;
	--mphbai-user-bg: #eef2ff;
	position: fixed;
	z-index: 99990;
}

#mphbai-root * {
	box-sizing: border-box;
}

/* Launcher */
.mphbai-launcher {
	position: fixed;
	bottom: 20px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0;
	height: 56px;
	min-width: 56px;
	border: none;
	border-radius: 28px;
	background: var(--mphbai-primary);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
	font-size: 15px;
	font-weight: 600;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mphbai-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.mphbai-launcher__icon {
	width: 56px;
	height: 56px;
	display: grid;
	place-items: center;
	flex: 0 0 auto;
}

.mphbai-launcher__icon svg {
	width: 26px;
	height: 26px;
}

.mphbai-launcher__label {
	padding-right: 20px;
	white-space: nowrap;
}

.mphbai-pos-right .mphbai-launcher,
.mphbai-pos-right .mphbai-panel {
	right: 20px;
}

.mphbai-pos-left .mphbai-launcher,
.mphbai-pos-left .mphbai-panel {
	left: 20px;
}

/* Panel */
.mphbai-panel {
	position: fixed;
	bottom: 20px;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 620px;
	max-height: calc(100vh - 40px);
	background: var(--mphbai-bg);
	color: var(--mphbai-fg);
	border-radius: 16px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
	display: none;
	flex-direction: column;
	overflow: hidden;
	font-size: 14px;
	line-height: 1.5;
}

.mphbai-open .mphbai-panel {
	display: flex;
}

.mphbai-open .mphbai-launcher {
	display: none;
}

/* Header */
.mphbai-header {
	background: var(--mphbai-primary);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 0 0 auto;
}

.mphbai-header__title {
	font-weight: 600;
	font-size: 15px;
}

.mphbai-header__close {
	background: transparent;
	border: none;
	color: #fff;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	padding: 4px;
	opacity: 0.9;
}

.mphbai-header__close:hover {
	opacity: 1;
}

/* Messages */
.mphbai-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f9fafb;
}

.mphbai-msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.mphbai-msg--bot {
	align-self: flex-start;
	background: var(--mphbai-bg);
	border: 1px solid var(--mphbai-border);
	border-bottom-left-radius: 4px;
}

.mphbai-msg--user {
	align-self: flex-end;
	background: var(--mphbai-user-bg);
	border-bottom-right-radius: 4px;
}

.mphbai-msg a {
	color: var(--mphbai-primary);
}

/* Typing indicator */
.mphbai-typing {
	align-self: flex-start;
	display: inline-flex;
	gap: 4px;
	padding: 12px 14px;
	background: var(--mphbai-bg);
	border: 1px solid var(--mphbai-border);
	border-radius: 14px;
}

.mphbai-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--mphbai-muted);
	animation: mphbai-bounce 1.2s infinite ease-in-out;
}

.mphbai-typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.mphbai-typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes mphbai-bounce {
	0%, 80%, 100% {
		transform: translateY(0);
		opacity: 0.5;
	}
	40% {
		transform: translateY(-5px);
		opacity: 1;
	}
}

/* Chips */
.mphbai-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 16px 10px;
	background: #f9fafb;
}

.mphbai-chip {
	border: 1px solid var(--mphbai-primary);
	color: var(--mphbai-primary);
	background: #fff;
	border-radius: 16px;
	padding: 6px 12px;
	font-size: 13px;
	cursor: pointer;
}

.mphbai-chip:hover {
	background: var(--mphbai-primary);
	color: #fff;
}

/* Composer */
.mphbai-composer {
	flex: 0 0 auto;
	border-top: 1px solid var(--mphbai-border);
	padding: 10px;
	display: flex;
	gap: 8px;
	align-items: flex-end;
	background: var(--mphbai-bg);
}

.mphbai-composer textarea {
	flex: 1 1 auto;
	resize: none;
	border: 1px solid var(--mphbai-border);
	border-radius: 10px;
	padding: 9px 11px;
	font: inherit;
	max-height: 96px;
	color: var(--mphbai-fg);
	background: #fff;
}

.mphbai-composer textarea:focus {
	outline: none;
	border-color: var(--mphbai-primary);
}

.mphbai-send {
	flex: 0 0 auto;
	border: none;
	background: var(--mphbai-primary);
	color: #fff;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	cursor: pointer;
	display: grid;
	place-items: center;
}

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

.mphbai-send svg {
	width: 18px;
	height: 18px;
}

.mphbai-consent {
	font-size: 11px;
	color: var(--mphbai-muted);
	padding: 0 12px 8px;
	text-align: center;
	background: var(--mphbai-bg);
}

.mphbai-consent a {
	color: var(--mphbai-muted);
	text-decoration: underline;
}

/* Mobile: full-height sheet */
@media (max-width: 640px) {
	.mphbai-panel {
		width: 100vw;
		max-width: 100vw;
		height: 88vh;
		max-height: 88vh;
		left: 0 !important;
		right: 0 !important;
		bottom: 0;
		border-radius: 16px 16px 0 0;
	}
}
