/*!
 * Mr. Beau Chat-Assistent – Styles (v1.1)
 * Alles ist unter #mrbeau-chat gekapselt. Die Akzentfarbe wird automatisch von den
 * Buttons der Webseite übernommen (siehe theme in knowledge.js).
 * Keine externen Schriften: Es wird die Schrift der Webseite genutzt (DSGVO).
 */
#mrbeau-chat {
	--mbc-accent: #1f2427;
	--mbc-accent-hover: #15191b;
	--mbc-accent-2: #3a4246;
	--mbc-accent-soft: #eef0f0;
	--mbc-on-accent: #ffffff;
	--mbc-gold: #b8996a;
	--mbc-bg: #f5f5f3;
	--mbc-paper: #ffffff;
	--mbc-text: #1c2023;
	--mbc-muted: #6b7275;
	--mbc-line: #e6e6e2;
	--mbc-heading-font: inherit;
	--mbc-lift: 0px;
	--mbc-edge: 24px;

	position: fixed !important;
	right: 24px !important;
	left: auto !important;
	top: auto !important;
	bottom: 24px !important;
	bottom: calc(24px + var(--mbc-lift)) !important;
	z-index: 2147483000 !important;
	display: flex !important;
	flex-direction: column;
	align-items: flex-end;
	gap: 16px;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--mbc-text);
	text-align: left;
	-webkit-font-smoothing: antialiased;
}
#mrbeau-chat.mbc--left {
	left: 24px !important;
	right: auto !important;
	align-items: flex-start;
}

#mrbeau-chat *,
#mrbeau-chat *::before,
#mrbeau-chat *::after { box-sizing: border-box; }

#mrbeau-chat [hidden] { display: none !important; }

#mrbeau-chat p,
#mrbeau-chat ul,
#mrbeau-chat li,
#mrbeau-chat h2 {
	margin: 0;
	padding: 0;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	color: inherit;
}
#mrbeau-chat button {
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	margin: 0;
	min-height: 0;
	box-shadow: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
#mrbeau-chat svg { display: block; flex-shrink: 0; }
#mrbeau-chat :focus { outline: none; }
#mrbeau-chat :focus-visible {
	outline: 2px solid var(--mbc-gold);
	outline-offset: 2px;
}
#mrbeau-chat .mbc-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Launcher (rundes Icon) ---------- */
#mrbeau-chat .mbc-launch-wrap {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
}
#mrbeau-chat.mbc--left .mbc-launch-wrap { flex-direction: row-reverse; }

#mrbeau-chat .mbc-launcher {
	position: relative;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 64px !important;
	height: 64px !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: linear-gradient(145deg, var(--mbc-accent-2), var(--mbc-accent)) !important;
	color: var(--mbc-on-accent) !important;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.18) !important;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#mrbeau-chat .mbc-launcher::after {
	content: '';
	position: absolute;
	inset: -3px;
	border-radius: 50%;
	border: 1.5px solid var(--mbc-gold);
	opacity: 0.9;
	pointer-events: none;
}
#mrbeau-chat .mbc-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32), 0 3px 8px rgba(0, 0, 0, 0.18) !important;
}
#mrbeau-chat .mbc-launcher:active { transform: scale(0.95); }

#mrbeau-chat .mbc-launcher-ico {
	position: absolute;
	display: flex;
	transition: opacity 0.2s ease, transform 0.25s ease;
}
#mrbeau-chat .mbc-launcher-ico--close { opacity: 0; transform: rotate(-90deg) scale(0.6); }
#mrbeau-chat.mbc--open .mbc-launcher-ico--chat { opacity: 0; transform: rotate(90deg) scale(0.6); }
#mrbeau-chat.mbc--open .mbc-launcher-ico--close { opacity: 1; transform: none; }

/* Hinweis-Puls (einmalig) */
#mrbeau-chat.mbc--nudge:not(.mbc--open) .mbc-launcher::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--mbc-accent);
	animation: mbc-ping 1.6s ease-out 2;
	pointer-events: none;
	z-index: -1;
}
@keyframes mbc-ping {
	0% { transform: scale(1); opacity: 0.45; }
	100% { transform: scale(1.7); opacity: 0; }
}

/* Tooltip-Label neben dem Icon */
#mrbeau-chat .mbc-tip {
	padding: 9px 14px;
	border-radius: 12px;
	background: var(--mbc-paper);
	color: var(--mbc-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.16);
	opacity: 0;
	transform: translateX(6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}
#mrbeau-chat.mbc--left .mbc-tip { transform: translateX(-6px); }
#mrbeau-chat .mbc-launch-wrap:hover .mbc-tip,
#mrbeau-chat.mbc--nudge:not(.mbc--open) .mbc-tip {
	opacity: 1;
	transform: none;
}
#mrbeau-chat.mbc--nudge:not(.mbc--open) .mbc-tip { animation: mbc-tip-out 0.3s ease 7s forwards; }
#mrbeau-chat.mbc--nudge:not(.mbc--open) .mbc-launch-wrap:hover .mbc-tip { animation: none; opacity: 1; }
@keyframes mbc-tip-out { to { opacity: 0; transform: translateX(6px); } }
#mrbeau-chat.mbc--open .mbc-tip { display: none; }

/* ---------- Panel ---------- */
#mrbeau-chat .mbc-panel {
	display: flex;
	flex-direction: column;
	width: min(400px, calc(100vw - 32px));
	height: min(640px, calc(100vh - 140px - var(--mbc-lift)));
	background: var(--mbc-bg);
	border-radius: 22px;
	overflow: hidden;
	box-shadow: 0 30px 70px rgba(0, 0, 0, 0.22), 0 4px 14px rgba(0, 0, 0, 0.1);
	transform-origin: bottom right;
	animation: mbc-in 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
#mrbeau-chat.mbc--left .mbc-panel { transform-origin: bottom left; }
@keyframes mbc-in {
	from { opacity: 0; transform: translateY(14px) scale(0.96); }
	to   { opacity: 1; transform: none; }
}

#mrbeau-chat .mbc-header {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 12px 18px 18px;
	background: linear-gradient(135deg, var(--mbc-accent-2) 0%, var(--mbc-accent) 70%);
	color: var(--mbc-on-accent);
}
#mrbeau-chat .mbc-header::after {
	content: '';
	position: absolute;
	left: 18px;
	right: 18px;
	bottom: 0;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--mbc-gold), transparent);
}
#mrbeau-chat .mbc-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	border: 1.5px solid var(--mbc-gold);
	color: var(--mbc-gold);
}
#mrbeau-chat .mbc-head-text { flex: 1; min-width: 0; }
#mrbeau-chat .mbc-title {
	font-family: var(--mbc-heading-font);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--mbc-on-accent);
}
#mrbeau-chat .mbc-subtitle {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 3px;
	font-size: 12.5px;
	line-height: 1.3;
	opacity: 0.8;
}
#mrbeau-chat .mbc-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #4cc38a;
	box-shadow: 0 0 0 3px rgba(76, 195, 138, 0.25);
}
#mrbeau-chat .mbc-icon-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	opacity: 0.85;
}
#mrbeau-chat .mbc-icon-btn:hover { background: rgba(255, 255, 255, 0.14); opacity: 1; }

/* ---------- Verlauf ---------- */
#mrbeau-chat .mbc-log {
	position: relative;
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 18px 16px 10px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	scrollbar-width: thin;
}

#mrbeau-chat .mbc-notice {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	padding: 10px 12px;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.035);
	font-size: 12px;
	line-height: 1.45;
	color: var(--mbc-muted);
}
#mrbeau-chat .mbc-notice svg { margin-top: 1px; }

#mrbeau-chat .mbc-row { display: flex; }
#mrbeau-chat .mbc-row--user { justify-content: flex-end; }
#mrbeau-chat .mbc-row { animation: mbc-msg 0.22s ease-out; }
@keyframes mbc-msg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

#mrbeau-chat .mbc-bubble {
	max-width: 88%;
	padding: 12px 15px;
	font-size: 14.5px;
	line-height: 1.55;
	overflow-wrap: anywhere;
}
#mrbeau-chat .mbc-bubble--bot {
	width: 100%;
	max-width: 92%;
	background: var(--mbc-paper);
	color: var(--mbc-text);
	border-radius: 6px 18px 18px 18px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 14px rgba(0, 0, 0, 0.04);
}
#mrbeau-chat .mbc-typing .mbc-bubble--bot { width: auto; }
#mrbeau-chat .mbc-bubble--user {
	background: var(--mbc-accent);
	color: var(--mbc-on-accent);
	border-radius: 18px 6px 18px 18px;
}
#mrbeau-chat .mbc-bubble > * + * { margin-top: 9px; }

#mrbeau-chat .mbc-list { list-style: none; }
#mrbeau-chat .mbc-list li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 7px 0;
	border-top: 1px dashed var(--mbc-line);
	font-size: 14px;
	line-height: 1.4;
}
#mrbeau-chat .mbc-list li:first-child { border-top: 0; padding-top: 2px; }
#mrbeau-chat .mbc-li-val {
	flex-shrink: 0;
	max-width: 55%;
	text-align: right;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

#mrbeau-chat .mbc-note { font-size: 13px; color: var(--mbc-muted); }

#mrbeau-chat .mbc-card {
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--mbc-bg);
	border: 1px solid var(--mbc-line);
	border-left: 3px solid var(--mbc-gold);
}
#mrbeau-chat .mbc-card-title {
	display: block;
	margin-bottom: 4px;
	font-family: var(--mbc-heading-font);
	font-size: 15.5px;
	font-weight: 600;
}

/* Link-Buttons */
#mrbeau-chat .mbc-links { display: flex; flex-direction: column; gap: 7px; }
#mrbeau-chat a.mbc-link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 14px;
	border: 1.5px solid var(--mbc-line);
	border-radius: 12px;
	background: var(--mbc-paper);
	color: var(--mbc-text) !important;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none !important;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
#mrbeau-chat a.mbc-link:hover { border-color: var(--mbc-accent); background: var(--mbc-accent-soft); }
#mrbeau-chat a.mbc-link--primary {
	border-color: var(--mbc-accent);
	background: var(--mbc-accent);
	color: var(--mbc-on-accent) !important;
}
#mrbeau-chat a.mbc-link--primary:hover { background: var(--mbc-accent-hover); border-color: var(--mbc-accent-hover); }

/* Start-Kacheln */
#mrbeau-chat .mbc-tiles {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
#mrbeau-chat .mbc-tile {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	padding: 12px;
	border: 1.5px solid var(--mbc-line);
	border-radius: 14px;
	background: var(--mbc-paper);
	color: var(--mbc-text);
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.25;
	text-align: left;
	transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
#mrbeau-chat .mbc-tile:hover {
	border-color: var(--mbc-gold);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
}
#mrbeau-chat .mbc-tile-ico {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: var(--mbc-accent);
	color: var(--mbc-on-accent);
}

/* Tipp-Anzeige */
#mrbeau-chat .mbc-typing .mbc-bubble { display: inline-flex; gap: 5px; padding: 15px 16px; }
#mrbeau-chat .mbc-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--mbc-muted);
	opacity: 0.35;
	animation: mbc-blink 1s infinite ease-in-out;
}
#mrbeau-chat .mbc-dot:nth-child(2) { animation-delay: 0.15s; }
#mrbeau-chat .mbc-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes mbc-blink { 50% { opacity: 1; transform: translateY(-2px); } }

/* ---------- Vorschläge ---------- */
#mrbeau-chat .mbc-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	padding: 4px 16px 12px;
	max-height: 38%;
	overflow-y: auto;
}
#mrbeau-chat .mbc-chip {
	padding: 8px 14px;
	border: 1.5px solid var(--mbc-accent);
	border-radius: 999px;
	background: var(--mbc-paper);
	color: var(--mbc-accent);
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.25;
	text-align: left;
	transition: background-color 0.15s ease, color 0.15s ease;
}
#mrbeau-chat .mbc-chip:hover { background: var(--mbc-accent); color: var(--mbc-on-accent); }

/* ---------- Eingabe ---------- */
#mrbeau-chat .mbc-form {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 12px;
	padding: 6px 6px 6px 16px;
	border: 1.5px solid var(--mbc-line);
	border-radius: 999px;
	background: var(--mbc-paper);
	transition: border-color 0.15s ease;
}
#mrbeau-chat .mbc-form:focus-within { border-color: var(--mbc-accent); }
#mrbeau-chat .mbc-input {
	flex: 1;
	min-width: 0;
	height: 40px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: var(--mbc-text) !important;
	font: inherit;
	font-size: 16px !important; /* verhindert Auto-Zoom auf iOS */
	box-shadow: none !important;
	outline: none !important;
}
#mrbeau-chat .mbc-send {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--mbc-accent);
	color: var(--mbc-on-accent);
	transition: background-color 0.15s ease;
}
#mrbeau-chat .mbc-send:hover { background: var(--mbc-accent-hover); }

#mrbeau-chat .mbc-foot {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 14px 12px;
	font-size: 11.5px;
	color: var(--mbc-muted);
}
#mrbeau-chat .mbc-foot-link {
	margin-left: 6px;
	color: var(--mbc-muted) !important;
	text-decoration: underline;
	text-underline-offset: 2px;
}
#mrbeau-chat .mbc-foot-link:hover { color: var(--mbc-text) !important; }

/* ---------- Mobil ---------- */
@media (max-width: 520px) {
	#mrbeau-chat {
		right: 16px !important;
		bottom: 16px !important;
		bottom: calc(16px + var(--mbc-lift)) !important;
	}
	#mrbeau-chat.mbc--left { left: 16px !important; }
	#mrbeau-chat .mbc-launcher { width: 58px !important; height: 58px !important; }
	#mrbeau-chat .mbc-tip { display: none; }
	#mrbeau-chat.mbc--open {
		inset: 0 !important;
		gap: 0;
	}
	#mrbeau-chat.mbc--open .mbc-launch-wrap { display: none; }
	#mrbeau-chat .mbc-panel {
		width: 100%;
		height: 100%;
		border-radius: 0;
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}
	#mrbeau-chat .mbc-header { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
	#mrbeau-chat *,
	#mrbeau-chat *::before,
	#mrbeau-chat *::after {
		animation: none !important;
		transition: none !important;
	}
}

@media print {
	#mrbeau-chat { display: none !important; }
}
