.amc-bot {
	--amc-accent: #7a3e9d;
	--amc-bg: #ffffff;
	--amc-soft: #f4f1f7;
	--amc-text: #231f2b;
	--amc-muted: #6b6477;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--amc-text);
	box-sizing: border-box;
}
.amc-bot *, .amc-bot *::before, .amc-bot *::after { box-sizing: inherit; }

.amc-panel {
	display: flex;
	flex-direction: column;
	background: var(--amc-bg);
	border: 1px solid #e3deea;
	border-radius: 16px;
	box-shadow: 0 6px 28px rgba(35, 31, 43, .12);
	overflow: hidden;
	max-width: 520px;
	width: 100%;
	height: min(640px, 80vh);
	margin: 0 auto;
}

.amc-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: var(--amc-accent);
	color: #fff;
}
.amc-avatar {
	width: 38px; height: 38px;
	display: grid; place-items: center;
	border-radius: 50%;
	background: rgba(255,255,255,.2);
	font-size: 18px;
}
.amc-title { display: flex; flex-direction: column; line-height: 1.25; flex: 1; }
.amc-title small { opacity: .85; font-size: 12px; }
.amc-close {
	background: transparent; border: 0; color: #fff;
	font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px;
}

.amc-progress { height: 4px; background: var(--amc-soft); }
.amc-progress span { display: block; height: 100%; width: 0; background: var(--amc-accent); transition: width .3s ease; }

.amc-log {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fbfafd;
	scroll-behavior: smooth;
}
.amc-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 15px;
	line-height: 1.45;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	animation: amc-in .2s ease;
}
.amc-bot-msg { align-self: flex-start; background: var(--amc-soft); border-bottom-left-radius: 4px; }
.amc-user-msg { align-self: flex-end; background: var(--amc-accent); color: #fff; border-bottom-right-radius: 4px; }
@keyframes amc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.amc-typing { display: inline-flex; gap: 4px; padding: 14px; }
.amc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--amc-muted); animation: amc-blink 1s infinite; }
.amc-typing span:nth-child(2) { animation-delay: .15s; }
.amc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes amc-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.amc-input {
	padding: 12px 14px;
	border-top: 1px solid #ece8f1;
	background: var(--amc-bg);
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-height: 70px;
}
.amc-row { display: flex; gap: 8px; align-items: flex-end; margin: 0; }
.amc-row input, .amc-row textarea {
	flex: 1;
	min-width: 0;
	font: inherit;
	font-size: 16px; /* prevents iOS zoom */
	padding: 11px 12px;
	border: 1px solid #cfc8d9;
	border-radius: 10px;
	background: #fff;
	color: var(--amc-text);
}
.amc-row input:focus, .amc-row textarea:focus { outline: 2px solid var(--amc-accent); outline-offset: 1px; border-color: transparent; }

.amc-send {
	font: inherit;
	font-weight: 600;
	padding: 11px 18px;
	border: 0;
	border-radius: 10px;
	background: var(--amc-accent);
	color: #fff;
	cursor: pointer;
}
.amc-send:hover { filter: brightness(1.08); }

.amc-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.amc-chip {
	font: inherit;
	font-size: 14px;
	padding: 9px 14px;
	border: 1px solid var(--amc-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--amc-accent);
	cursor: pointer;
}
.amc-chip:hover, .amc-chip:focus-visible { background: var(--amc-accent); color: #fff; }
.amc-chip-alt { align-self: flex-start; border-color: #cfc8d9; color: var(--amc-muted); }

.amc-back {
	align-self: flex-start;
	background: none; border: 0; padding: 2px 0;
	font: inherit; font-size: 13px; color: var(--amc-muted); cursor: pointer;
}
.amc-back:hover { color: var(--amc-accent); }

.amc-error { color: #b3261e; font-size: 13px; }
.amc-consent { display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.45; }
.amc-consent-label { display: flex; gap: 8px; align-items: flex-start; }
.amc-consent-label input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.amc-privacy { color: var(--amc-accent); }
.amc-done { color: #1d7a45; font-weight: 600; text-align: center; padding: 8px; }

.amc-foot { padding: 8px 14px 10px; font-size: 11px; color: var(--amc-muted); background: var(--amc-bg); text-align: center; }

.amc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* Popup mode */
.amc-mode-popup .amc-panel {
	display: none;
	position: fixed;
	right: 20px; bottom: 84px;
	width: min(400px, calc(100vw - 24px));
	height: min(620px, calc(100vh - 110px));
	z-index: 99999;
}
.amc-mode-popup.amc-open .amc-panel { display: flex; }
.amc-launcher {
	position: fixed; right: 20px; bottom: 20px; z-index: 99998;
	font: inherit; font-weight: 600; font-size: 15px;
	padding: 14px 22px;
	border: 0; border-radius: 999px;
	background: var(--amc-accent); color: #fff;
	box-shadow: 0 6px 20px rgba(0,0,0,.25);
	cursor: pointer;
}
.amc-mode-popup.amc-open .amc-launcher { display: none; }

@media (max-width: 480px) {
	.amc-mode-popup .amc-panel { right: 8px; left: 8px; width: auto; bottom: 8px; height: calc(100vh - 16px); }
	.amc-panel { border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.amc-msg, .amc-typing span, .amc-progress span { animation: none; transition: none; }
}
