/* Markital chat assistant */
.mkc {
	--mkc-w: 380px;
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 90;
	font-family: var(--font-body);
	color: var(--ink);
}

/* Launcher */
.mkc-launch {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 58px;
	padding: 0 22px 0 8px;
	margin-left: auto;
	border-radius: var(--r-pill);
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 700;
	font-size: 15px;
	box-shadow: 0 16px 40px -14px rgba(124, 224, 42, .7), 0 0 0 1px rgba(124, 224, 42, .4);
	transition: transform .25s var(--ease), box-shadow .25s, padding .25s var(--ease);
}
.mkc-launch:hover { transform: translateY(-2px); box-shadow: 0 20px 48px -14px rgba(124, 224, 42, .85), 0 0 0 1px rgba(124, 224, 42, .5); }
.mkc-launch__ico {
	position: relative;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--accent-ink);
	color: var(--accent);
}
.mkc-launch__ico svg {
	position: absolute;
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform .3s var(--ease), opacity .2s;
}
.mkc-i-close { opacity: 0; transform: rotate(-90deg); }
.mkc.is-open .mkc-i-chat { opacity: 0; transform: rotate(90deg); }
.mkc.is-open .mkc-i-close { opacity: 1; transform: none; }
.mkc-launch__dot {
	position: absolute;
	top: 6px;
	left: 38px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #F2F6F1;
	border: 2px solid var(--accent);
}
.mkc-launch__dot::after {
	content: "";
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid #F2F6F1;
	animation: mkc-ping 2s var(--ease) infinite;
}
.mkc.is-open .mkc-launch__dot { display: none; }
@keyframes mkc-ping {
	0% { transform: scale(.6); opacity: .9; }
	100% { transform: scale(1.6); opacity: 0; }
}

/* Teaser */
.mkc-teaser {
	position: absolute;
	right: 0;
	bottom: 72px;
	width: 250px;
	padding: 14px 34px 14px 16px;
	border-radius: var(--r-md) var(--r-md) 4px var(--r-md);
	background: var(--surface);
	border: 1px solid var(--line);
	box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .6);
	font-size: 14px;
	line-height: 1.45;
	cursor: pointer;
	animation: mkc-rise .4s var(--ease);
}
.mkc-teaser[hidden] { display: none; }
.mkc-teaser__x {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	color: var(--muted);
	font-size: 18px;
	line-height: 1;
}
.mkc-teaser__x:hover { color: var(--ink); }

/* Panel */
.mkc-panel {
	position: absolute;
	right: 0;
	bottom: 74px;
	width: var(--mkc-w);
	height: min(620px, calc(100vh - 130px));
	display: flex;
	flex-direction: column;
	border-radius: 22px;
	background: #0D140F;
	border: 1px solid var(--line);
	box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(124, 224, 42, .06);
	overflow: hidden;
	opacity: 0;
	transform: translateY(14px) scale(.98);
	transform-origin: bottom right;
	transition: opacity .22s var(--ease), transform .3s var(--ease);
}
.mkc-panel[hidden] { display: none; }
.mkc-panel.is-in { opacity: 1; transform: none; }

.mkc-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 12px 14px 16px;
	background:
		radial-gradient(120% 140% at 0% 0%, rgba(124, 224, 42, .16), transparent 60%),
		var(--surface);
	border-bottom: 1px solid var(--line);
}
.mkc-head__av {
	width: 40px;
	height: auto;
	padding: 6px 4px;
	border-radius: 12px;
	background: var(--bg);
	border: 1px solid var(--line);
	box-sizing: content-box;
}
.mkc-head__meta { flex: 1; display: grid; line-height: 1.25; min-width: 0; }
.mkc-head__meta strong { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.mkc-head__meta span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.mkc-head__meta i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(124, 224, 42, .2); }
.mkc-head__btn {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: var(--muted);
	transition: color .2s, background-color .2s;
}
.mkc-head__btn:hover { color: var(--ink); background: var(--surface-2); }
.mkc-head__btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.mkc-log {
	flex: 1;
	overflow-y: auto;
	padding: 18px 16px 8px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	scroll-behavior: smooth;
	overscroll-behavior: contain;
}
.mkc-log::-webkit-scrollbar { width: 6px; }
.mkc-log::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }

.mkc-msg {
	max-width: 86%;
	padding: 10px 14px;
	font-size: 14.5px;
	line-height: 1.5;
	white-space: pre-line;
	overflow-wrap: anywhere;
	animation: mkc-rise .3s var(--ease);
}
.mkc-msg--bot {
	align-self: flex-start;
	background: var(--surface-2);
	border: 1px solid var(--line);
	border-radius: 4px 16px 16px 16px;
}
.mkc-msg--user {
	align-self: flex-end;
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 600;
	border-radius: 16px 4px 16px 16px;
}
@keyframes mkc-rise {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

.mkc-typing { display: flex; gap: 4px; padding: 14px 16px; }
.mkc-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--muted);
	animation: mkc-dot 1s infinite ease-in-out;
}
.mkc-typing span:nth-child(2) { animation-delay: .15s; }
.mkc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes mkc-dot {
	0%, 80%, 100% { transform: translateY(0); opacity: .45; }
	40% { transform: translateY(-4px); opacity: 1; }
}

.mkc-choices {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
	padding: 4px 16px 12px;
	max-height: 40%;
	overflow-y: auto;
}
.mkc-choices:empty { display: none; }
.mkc-chip {
	padding: 8px 14px;
	border-radius: var(--r-pill);
	border: 1px solid rgba(124, 224, 42, .45);
	color: var(--accent);
	font-size: 13.5px;
	font-weight: 600;
	transition: background-color .2s, color .2s, transform .2s var(--ease);
	animation: mkc-rise .3s var(--ease);
}
.mkc-chip:hover { background: var(--accent); color: var(--accent-ink); }
.mkc-chip:active { transform: scale(.97); }

.mkc-form {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 12px;
	padding: 6px 6px 6px 16px;
	border-radius: var(--r-pill);
	background: var(--surface);
	border: 1px solid var(--line);
	transition: border-color .2s;
}
.mkc-form:focus-within { border-color: rgba(124, 224, 42, .6); }
.mkc-input {
	flex: 1;
	min-width: 0;
	height: 38px;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--ink);
	font: inherit;
	font-size: 16px;
}
.mkc-input::placeholder { color: #7C8B80; }
.mkc-send {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--accent);
	color: var(--accent-ink);
	flex-shrink: 0;
	transition: transform .2s var(--ease);
}
.mkc-send:hover { transform: translateX(2px); }
.mkc-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mkc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.mkc-foot { padding: 8px 16px 12px; font-size: 11.5px; color: #7C8B80; text-align: center; }

/* Mobile: full-width sheet */
@media (max-width: 600px) {
	.mkc { right: 16px; bottom: 16px; }
	.mkc-launch { height: 54px; padding: 0 6px; }
	.mkc-launch__txt { display: none; }
	.mkc-launch__dot { left: 34px; top: 4px; }
	.mkc-teaser { bottom: 66px; width: min(260px, calc(100vw - 32px)); }
	.mkc-panel {
		position: fixed;
		inset: auto 0 0 0;
		width: 100%;
		height: min(86svh, 680px);
		border-radius: 22px 22px 0 0;
		transform-origin: bottom center;
	}
	.mkc.is-open .mkc-launch { opacity: 0; pointer-events: none; }
}

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