/* AMC Chatbot widget styles */

#amc-chatbot-root {
	--amc-primary: #0067b8;
	--amc-primary-dark: #005da6;
	--amc-bg: #ffffff;
	--amc-surface: #f3f2f1;
	--amc-text: #201f1e;
	--amc-muted: #605e5c;
	--amc-border: #e1dfdd;
	--amc-user-bubble: #0067b8;
	--amc-bot-bubble: #f3f2f1;
	--amc-radius: 12px;
	--amc-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
	font-family: "Segoe UI", "Segoe UI Web", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

/* Launcher button — pill with icon + label. Collapses to an icon-only circle
   on phones (see media queries). */
.amc-chatbot-launcher {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 99998;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	gap: 10px;
	height: 65px;
	min-height: 65px;
	min-width: 65px;
	padding: 0 22px;
	border: 1px solid #fff;
	border-radius: 999px !important;
	background: linear-gradient(135deg, var(--amc-primary) 0%, var(--amc-primary-dark) 100%);
	color: #fff;
	cursor: pointer;
	line-height: 1;
	white-space: nowrap;
	box-shadow: var(--amc-shadow);
	transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
	animation: amc-launcher-pulse 3s ease-out infinite;
}

.amc-chatbot-launcher:hover {
	background: linear-gradient(135deg, var(--amc-primary-dark) 0%, #004a85 100%);
	transform: scale(1.04);
}

.amc-chatbot-launcher svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
}

/* Match the header bot icon: white bubble with blue "lines" punched through,
   so it reads clearly on the launcher's blue gradient. */
.amc-chatbot-launcher svg path {
	fill: #fff;
}

.amc-chatbot-launcher svg rect {
	fill: var(--amc-primary);
}

.amc-chatbot-launcher-label {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 5px;
	line-height: 1.15;
	color: #fff;
}

.amc-chatbot-launcher-label-title {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.2px;
	line-height: 1.15;
}

.amc-chatbot-launcher-label-sub {
	font-size: 12px;
	font-weight: 400;
	line-height: 1.15;
	opacity: 0.92;
}

@keyframes amc-launcher-pulse {
	0% {
		box-shadow: var(--amc-shadow), 0 0 0 0 rgba(0, 103, 184, 0.45);
	}
	70% {
		box-shadow: var(--amc-shadow), 0 0 0 14px rgba(0, 103, 184, 0);
	}
	100% {
		box-shadow: var(--amc-shadow), 0 0 0 0 rgba(0, 103, 184, 0);
	}
}

.amc-chatbot-launcher.is-open {
	display: none;
}

/* Force the fully-rounded (pill / circle) shape even if a host theme
   button/.btn rule flattens the corners (some theme rules set
   border-radius: 0 !important on buttons). A large radius yields rounded pill
   ends when the launcher is wide and a full circle when it is square. */
#amc-chatbot-root .amc-chatbot-launcher {
	border: 1px solid #fff !important;
	border-radius: 999px !important;
}

/* Guard the launcher SVG against host theme img/svg rules stretching it. */
#amc-chatbot-root .amc-chatbot-launcher svg {
	flex: 0 0 auto;
	max-width: 28px;
	max-height: 28px;
}

/* Chat panel */
.amc-chatbot-panel {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	width: 412px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 48px);
	background: var(--amc-bg);
	border: 1px solid var(--amc-border);
	border-radius: var(--amc-radius);
	box-shadow: var(--amc-shadow);
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px) scale(0.98);
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.amc-chatbot-panel.is-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* Expanded view: fill the viewport with equal gaps on every side. Anchoring
   both left & right (and letting width be auto) keeps the side spacing
   symmetric at any screen size, including mobile. */
#amc-chatbot-root .amc-chatbot-panel.is-expanded {
	box-sizing: border-box;
	top: 2.5vh;
	right: 2.5vw;
	bottom: 2.5vh;
	left: 2.5vw;
	width: auto;
	height: auto;
	max-width: none;
	max-height: none;
}

/* Minimized view: collapse to just the header bar, docked bottom-right.
   Placed after .is-expanded so it wins when both are set. */
#amc-chatbot-root .amc-chatbot-panel.is-minimized {
	width: 320px;
	max-width: calc(100vw - 32px);
	height: auto;
	max-height: none;
	top: auto;
	left: auto;
	right: 24px;
	bottom: 24px;
}

#amc-chatbot-root .amc-chatbot-panel.is-minimized .amc-chatbot-messages,
#amc-chatbot-root .amc-chatbot-panel.is-minimized .amc-chatbot-inputbar {
	display: none;
}

#amc-chatbot-root .amc-chatbot-panel.is-minimized .amc-chatbot-subtitle {
	display: none;
}

/* Remove the default focus outline on click, but keep a subtle ring for
   keyboard navigation (accessibility). */
#amc-chatbot-root button:focus,
#amc-chatbot-root textarea:focus,
#amc-chatbot-root a:focus,
#amc-chatbot-root summary:focus {
	outline: none;
}

#amc-chatbot-root button:focus-visible,
#amc-chatbot-root textarea:focus-visible,
#amc-chatbot-root a:focus-visible,
#amc-chatbot-root summary:focus-visible {
	outline: 2px solid var(--amc-primary);
	outline-offset: 2px;
}

/* Header */
.amc-chatbot-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: var(--amc-primary);
	color: #fff;
}

.amc-chatbot-header-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex: 0 0 auto;
}

.amc-chatbot-header-icon svg {
	width: 30px;
	height: 30px;
}

/* White bubble on the blue header; the lines take the header colour so they
   read as punched-through (stays in sync with --amc-primary). */
.amc-chatbot-header-icon svg path {
	fill: #fff;
}

.amc-chatbot-header-icon svg rect {
	fill: var(--amc-primary);
}

.amc-chatbot-header-text {
	flex: 1 1 auto;
	min-width: 0;
}

.amc-chatbot-title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
}

.amc-chatbot-subtitle {
	font-size: 12px;
	opacity: 0.85;
	line-height: 1.3;
}

/* Header action buttons (scoped + reset so host theme button styles can't
   shrink or hide them). */
#amc-chatbot-root .amc-chatbot-clear,
#amc-chatbot-root .amc-chatbot-expand,
#amc-chatbot-root .amc-chatbot-minimize,
#amc-chatbot-root .amc-chatbot-close {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: #fff;
	cursor: pointer;
	flex: 0 0 auto;
	box-shadow: none;
	line-height: 1;
}

#amc-chatbot-root .amc-chatbot-clear {
	opacity: 0.9;
}

/* Tighten spacing between the header action buttons (header gap is 12px). */
#amc-chatbot-root .amc-chatbot-expand,
#amc-chatbot-root .amc-chatbot-clear,
#amc-chatbot-root .amc-chatbot-minimize {
	margin-right: -12px;
}

#amc-chatbot-root .amc-chatbot-clear:hover,
#amc-chatbot-root .amc-chatbot-expand:hover,
#amc-chatbot-root .amc-chatbot-minimize:hover,
#amc-chatbot-root .amc-chatbot-close:hover {
	background: rgba(255, 255, 255, 0.18);
	opacity: 1;
}

#amc-chatbot-root .amc-chatbot-close svg {
	width: 18px;
	height: 18px;
	fill: #fff;
	flex: 0 0 auto;
}

#amc-chatbot-root .amc-chatbot-clear svg,
#amc-chatbot-root .amc-chatbot-expand svg,
#amc-chatbot-root .amc-chatbot-minimize svg {
	width: 17px;
	height: 17px;
	fill: #fff;
	flex: 0 0 auto;
}

/* Messages */
.amc-chatbot-messages {
	flex: 1 1 auto;
	min-height: 0;
	padding: 16px;
	overflow-y: auto;
	background: var(--amc-bg);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.amc-chatbot-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 13px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.amc-chatbot-msg-bot {
	align-self: flex-start;
	background: var(--amc-bot-bubble);
	color: var(--amc-text);
	border-bottom-left-radius: 4px;
}

/* Structured bot content (paragraphs, bold labels, related-links list) */
#amc-chatbot-root .amc-chatbot-msg-bot {
	white-space: normal;
}

#amc-chatbot-root .amc-chatbot-msg-bot p {
	margin: 0 0 8px;
	font-size: 13px;
	line-height: 1.45;
}

#amc-chatbot-root .amc-chatbot-msg-bot p:last-child {
	margin-bottom: 0;
}

#amc-chatbot-root .amc-chatbot-msg-bot li {
	font-size: 13px;
	line-height: 1.4;
}

#amc-chatbot-root .amc-chatbot-answer-list {
	display: block;
	margin: 0 0 8px;
	padding: 0 0 0 22px;
	list-style: none !important;
	counter-reset: amc-answer-list;
}

#amc-chatbot-root .amc-chatbot-answer-list-ordered {
	counter-reset: amc-answer-list;
}

#amc-chatbot-root .amc-chatbot-answer-list > li {
	position: relative;
	margin: 0 0 4px;
	padding-left: 2px;
	list-style: none !important;
}

#amc-chatbot-root .amc-chatbot-answer-list:not(.amc-chatbot-answer-list-ordered) > li::before {
	content: "\2022" !important;
	position: absolute;
	left: -16px;
	color: var(--amc-primary);
	font-weight: 700;
}

#amc-chatbot-root .amc-chatbot-answer-list-ordered > li {
	counter-increment: amc-answer-list;
}

#amc-chatbot-root .amc-chatbot-answer-list-ordered > li::before {
	content: counter(amc-answer-list) "." !important;
	position: absolute;
	left: -22px;
	color: var(--amc-primary);
	font-weight: 600;
}

#amc-chatbot-root .amc-chatbot-msg-bot strong {
	font-weight: 600;
}

#amc-chatbot-root .amc-chatbot-msg-bot h1,
#amc-chatbot-root .amc-chatbot-msg-bot h2,
#amc-chatbot-root .amc-chatbot-msg-bot h3,
#amc-chatbot-root .amc-chatbot-msg-bot h4,
#amc-chatbot-root .amc-chatbot-msg-bot h5,
#amc-chatbot-root .amc-chatbot-msg-bot h6 {
	margin: 10px 0 6px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
}

#amc-chatbot-root .amc-chatbot-msg-bot h1:first-child,
#amc-chatbot-root .amc-chatbot-msg-bot h2:first-child,
#amc-chatbot-root .amc-chatbot-msg-bot h3:first-child {
	margin-top: 0;
}

#amc-chatbot-root .amc-chatbot-msg-bot em {
	font-style: italic;
}

#amc-chatbot-root .amc-chatbot-table-wrap {
	max-width: 100%;
	margin: 10px 0;
	overflow-x: auto;
	border: 1px solid var(--amc-border);
	border-radius: 8px;
}

#amc-chatbot-root .amc-chatbot-table {
	width: 100%;
	min-width: 420px;
	border-collapse: collapse;
	font-size: 12px;
	line-height: 1.45;
}

#amc-chatbot-root .amc-chatbot-table th,
#amc-chatbot-root .amc-chatbot-table td {
	padding: 8px 10px;
	border-bottom: 1px solid var(--amc-border);
	text-align: left;
	vertical-align: top;
}

#amc-chatbot-root .amc-chatbot-table th {
	background: rgba(0, 103, 184, 0.08);
	font-weight: 700;
}

#amc-chatbot-root .amc-chatbot-table tr:last-child td {
	border-bottom: 0;
}

#amc-chatbot-root .amc-chatbot-table th.is-center,
#amc-chatbot-root .amc-chatbot-table td.is-center {
	text-align: center;
}

#amc-chatbot-root .amc-chatbot-table th.is-right,
#amc-chatbot-root .amc-chatbot-table td.is-right {
	text-align: right;
}

#amc-chatbot-root .amc-chatbot-msg-bot hr {
	margin: 10px 0;
	border: 0;
	border-top: 1px solid var(--amc-border);
}

/* Welcome screen: centered heading, intro copy and pill-shaped chips. */
#amc-chatbot-root .amc-chatbot-welcome {
	max-width: 100%;
	align-self: stretch;
	background: transparent;
	padding: 24px 24px 20px;
	border-radius: 0;
}

#amc-chatbot-root .amc-chatbot-welcome .amc-chatbot-msg-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

#amc-chatbot-root .amc-chatbot-welcome-title {
	margin: 0 0 10px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--amc-text);
}

#amc-chatbot-root .amc-chatbot-welcome-sub {
	margin: 0 0 8px;
	max-width: 340px;
	font-size: 13px !important;
	line-height: 1.55;
	color: var(--amc-muted);
}

#amc-chatbot-root .amc-chatbot-suggestions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin: 12px;
}

#amc-chatbot-root .amc-chatbot-suggestion {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	flex: 0 0 auto;
	max-width: 100%;
	padding: 9px 16px;
	border: 1px solid var(--amc-border);
	border-radius: 999px !important;
	background: #fff;
	color: var(--amc-text);
	font-family: inherit;
	font-size: 12px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

/* First (longer) chip gets its own centered row; the rest share the next. */
#amc-chatbot-root .amc-chatbot-suggestion:first-child {
	flex-basis: 100%;
	max-width: max-content;
}

#amc-chatbot-root .amc-chatbot-suggestion:hover {
	background: #eaf3fb;
	border-color: var(--amc-primary);
	color: var(--amc-primary);
}

#amc-chatbot-root .amc-chatbot-suggestion:active {
	transform: scale(0.98);
}

#amc-chatbot-root .amc-chatbot-welcome-outro {
	margin: 12px 0 0;
	max-width: 340px;
	font-size: 12px;
	line-height: 1.5;
	color: var(--amc-muted);
	color: #64748b;
    font-style: italic;
}

/* Collapsible "Related Links" section (native <details>, open by default) */
#amc-chatbot-root .amc-chatbot-related {
	margin-top: 12px;
	padding: 8px;
	border-radius: 10px;
	background: #ebebeb;
}

#amc-chatbot-root .amc-chatbot-related > summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border: 1px solid #d9d9d9;
	border-radius: 8px;
	background: #e1e1e1;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--amc-muted);
	user-select: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

#amc-chatbot-root .amc-chatbot-related > summary:hover {
	background: #cfcece;
	border-color: #b8b7b7;
}

#amc-chatbot-root .amc-chatbot-related-title {
	margin-right: auto;
}

/* Article count pill on the right of the heading. */
#amc-chatbot-root .amc-chatbot-related-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--amc-primary);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0;
}

#amc-chatbot-root .amc-chatbot-related > summary::before {
	content: "";
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='16' rx='2.5' fill='%230067b8'/%3E%3Crect x='5.5' y='6.5' width='8' height='5' rx='1' fill='%23ffd16a'/%3E%3Crect x='15' y='6.5' width='3.5' height='2' rx='1' fill='%23ffffff'/%3E%3Crect x='15' y='9.5' width='3.5' height='2' rx='1' fill='%23ffffff'/%3E%3Crect x='5.5' y='14' width='13' height='1.8' rx='0.9' fill='%23ffffff'/%3E%3Crect x='5.5' y='17' width='9' height='1.8' rx='0.9' fill='%23ffffff'/%3E%3C/svg%3E") no-repeat center / contain;
}

#amc-chatbot-root .amc-chatbot-related > summary::-webkit-details-marker {
	display: none;
}

#amc-chatbot-root .amc-chatbot-related > summary::after {
	content: "\25BE"; /* down triangle */
	font-size: 18px;
	line-height: 1;
	transition: transform 0.15s ease;
}

#amc-chatbot-root .amc-chatbot-related:not([open]) > summary::after {
	transform: rotate(-90deg);
}

#amc-chatbot-root .amc-chatbot-links {
	list-style: none;
	margin: 0;
	padding: 4px 0 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

#amc-chatbot-root .amc-chatbot-links.amc-chatbot-ordered {
	display: block;
	list-style: decimal;
	padding-left: 22px;
}

#amc-chatbot-root .amc-chatbot-ordered li {
	margin: 0 0 4px;
}

#amc-chatbot-root .amc-chatbot-links li {
	position: relative;
	margin: 0;
	padding: 6px 8px 6px 20px;
	border-radius: 8px;
	list-style: none;
	transition: background 0.15s ease;
}

#amc-chatbot-root .amc-chatbot-links li a {
	display: inline;
	text-decoration: none;
	font-weight: 500;
}

#amc-chatbot-root .amc-chatbot-links li::before {
	content: "";
	position: absolute;
	left: 8px;
	top: calc(0.7em + 3px);
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--amc-primary);
}

#amc-chatbot-root .amc-chatbot-links li a::after {
	content: "\2197"; /* north-east arrow */
	display: inline-block;
	margin-left: 4px;
	font-size: 13px;
	color: var(--amc-muted);
	opacity: 0;
	transition: opacity 0.15s ease;
}

#amc-chatbot-root .amc-chatbot-links li:hover {
	background: rgba(0, 103, 184, 0.08);
}

#amc-chatbot-root .amc-chatbot-links li a:hover {
	text-decoration: none;
}

#amc-chatbot-root .amc-chatbot-links li a:hover::after {
	opacity: 1;
}

#amc-chatbot-root .amc-chatbot-msg-bot a {
	display: inline;
	color: var(--amc-primary);
	text-decoration: underline;
	word-break: break-word;
}

#amc-chatbot-root .amc-chatbot-msg-bot a:hover {
	color: var(--amc-primary-dark);
}

/* Thumbs up/down feedback row at the end of a bot answer. */
#amc-chatbot-root .amc-chatbot-feedback {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid var(--amc-border);
}

#amc-chatbot-root .amc-chatbot-feedback-label {
	font-size: 12px;
	line-height: 1.3;
	color: var(--amc-muted);
}

#amc-chatbot-root .amc-chatbot-feedback-actions {
	display: flex;
	gap: 6px;
	flex: 0 0 auto;
}

#amc-chatbot-root .amc-chatbot-feedback-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

/* Timestamp sitting on the left of the feedback row (not a separate line). */
#amc-chatbot-root .amc-chatbot-feedback .amc-chatbot-msg-time {
	margin-top: 0;
	white-space: nowrap;
}

#amc-chatbot-root .amc-chatbot-fb {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	min-width: 26px;
	min-height: 26px;
	padding: 0;
	margin: 0;
	border: 1px solid var(--amc-border);
	border-radius: 8px;
	background: #fff;
	color: var(--amc-muted);
	cursor: pointer;
	box-shadow: none;
	line-height: 1;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

#amc-chatbot-root .amc-chatbot-fb:hover {
	color: var(--amc-text);
	border-color: var(--amc-muted);
	background: rgba(0, 0, 0, 0.03);
}

#amc-chatbot-root .amc-chatbot-fb:active {
	transform: scale(0.92);
}

#amc-chatbot-root .amc-chatbot-fb svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
	flex: 0 0 auto;
}

#amc-chatbot-root .amc-chatbot-fb-up.is-active {
	color: #1a7f37;
	border-color: #1a7f37;
	background: rgba(26, 127, 55, 0.1);
}

#amc-chatbot-root .amc-chatbot-fb-down.is-active {
	color: #cf222e;
	border-color: #cf222e;
	background: rgba(207, 34, 46, 0.1);
}

/* Once a rating is chosen, dim the unselected button. */
#amc-chatbot-root .amc-chatbot-feedback[data-sent] .amc-chatbot-fb:not(.is-active) {
	opacity: 0.45;
}

.amc-chatbot-msg-user {
	align-self: flex-end;
	background: var(--amc-user-bubble);
	color: #fff;
	border-bottom-right-radius: 4px;
}

/* Per-message timestamp */
#amc-chatbot-root .amc-chatbot-msg-time {
	margin-top: 6px;
	font-size: 11px;
	line-height: 1;
	text-align: right;
	color: var(--amc-muted);
}

#amc-chatbot-root .amc-chatbot-msg-user .amc-chatbot-msg-time {
	color: rgba(255, 255, 255, 0.8);
}

/* Blinking caret while a bot answer is streaming in */
.amc-chatbot-msg-bot.amc-chatbot-streaming .amc-chatbot-msg-content::after {
	content: "";
	display: inline-block;
	width: 2px;
	height: 1.1em;
	margin-left: 2px;
	vertical-align: text-bottom;
	background: var(--amc-muted);
	animation: amc-caret 1s steps(1) infinite;
}

@keyframes amc-caret {
	0%, 50% {
		opacity: 1;
	}
	50.01%, 100% {
		opacity: 0;
	}
}

/* Typing indicator */
.amc-chatbot-typing {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	padding: 12px 14px;
	background: var(--amc-bot-bubble);
	border-radius: 14px;
	border-bottom-left-radius: 4px;
}

.amc-chatbot-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--amc-muted);
	animation: amc-bounce 1.2s infinite ease-in-out;
}

.amc-chatbot-typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.amc-chatbot-typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes amc-bounce {
	0%, 60%, 100% {
		transform: translateY(0);
		opacity: 0.5;
	}
	30% {
		transform: translateY(-5px);
		opacity: 1;
	}
}

/* Footer / input */
.amc-chatbot-inputbar {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid var(--amc-border);
	background: var(--amc-bg);
}

.amc-chatbot-input {
	flex: 1 1 auto;
	resize: none;
	max-height: 120px;
	min-height: 40px;
	padding: 10px 12px;
	border: 1px solid var(--amc-border);
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
	color: var(--amc-text);
	outline: none;
}

.amc-chatbot-input:focus {
	border-color: var(--amc-primary);
	box-shadow: 0 0 0 1px var(--amc-primary);
}

.amc-chatbot-send {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	border: none;
	border-radius: 8px;
	background: var(--amc-primary);
	color: #fff;
	cursor: pointer;
	transition: background 0.15s ease;
}

.amc-chatbot-send:hover:not(:disabled) {
	background: var(--amc-primary-dark);
}

.amc-chatbot-send:disabled {
	background: #c8c6c4;
	cursor: not-allowed;
}

.amc-chatbot-send svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* Confirmation dialog (e.g. "End conversation") shown over the panel. */
#amc-chatbot-root .amc-chatbot-confirm {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(32, 31, 30, 0.45);
}

/* Minimized state: the panel is just a docked header bar, so the confirm
   overlay is attached to the root and covers the viewport, with the dialog
   card anchored just above the minimized bar (bottom-right). The panel stays
   minimized. */
#amc-chatbot-root .amc-chatbot-confirm-minimized {
	position: fixed;
	inset: 0;
	z-index: 100000;
	align-items: flex-end;
	justify-content: flex-end;
	padding: 0;
}

#amc-chatbot-root .amc-chatbot-confirm-minimized .amc-chatbot-confirm-card {
	margin: 0 24px 96px 24px;
	max-width: 320px;
}

#amc-chatbot-root .amc-chatbot-confirm-card {
	box-sizing: border-box;
	width: 100%;
	max-width: 300px;
	padding: 18px;
	background: var(--amc-bg);
	border-radius: 12px;
	box-shadow: var(--amc-shadow);
}

#amc-chatbot-root .amc-chatbot-confirm-title {
	margin-bottom: 6px;
	font-size: 15px;
	font-weight: 700;
	color: var(--amc-text);
}

#amc-chatbot-root .amc-chatbot-confirm-text {
	margin: 0 0 16px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--amc-muted);
}

#amc-chatbot-root .amc-chatbot-confirm-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

#amc-chatbot-root .amc-chatbot-confirm-btn {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	padding: 8px 14px;
	border: 1px solid transparent;
	border-radius: 8px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

#amc-chatbot-root .amc-chatbot-confirm-cancel {
	background: #fff;
	color: var(--amc-text);
	border-color: var(--amc-border);
}

#amc-chatbot-root .amc-chatbot-confirm-cancel:hover {
	background: rgba(0, 0, 0, 0.04);
}

#amc-chatbot-root .amc-chatbot-confirm-end {
	background: var(--amc-primary);
	color: #fff;
}

#amc-chatbot-root .amc-chatbot-confirm-end:hover {
	background: var(--amc-primary-dark);
}

@media (max-width: 1024px) {
	/* Tablets (incl. iPad Pro) and any touch/coarse-pointer device: force the
	   launcher to stay visible and correctly sized. High specificity (id +
	   class) beats host/theme rules that may hide fixed elements at these
	   breakpoints. */
	#amc-chatbot-root .amc-chatbot-launcher {
		display: flex;
		height: 60px;
		min-height: 60px;
		min-width: 60px;
		padding: 0 20px;
		bottom: calc(20px + env(safe-area-inset-bottom, 0px));
		right: calc(20px + env(safe-area-inset-right, 0px));
	}
	#amc-chatbot-root .amc-chatbot-launcher.is-open {
		display: none;
	}
	#amc-chatbot-root .amc-chatbot-launcher svg {
		width: 26px;
		height: 26px;
		max-width: 26px;
		max-height: 26px;
	}
}

@media (max-width: 480px) {
	.amc-chatbot-panel {
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		width: 100vw;
		max-width: 100vw;
		height: 100vh;
		height: 100dvh;
		max-height: 100vh;
		max-height: 100dvh;
		border-radius: 0;
	}
	.amc-chatbot-launcher {
		bottom: 16px;
		right: 16px;
	}
	/* Collapse to an icon-only circle on phones: hide the label and revert to a
	   fixed square so the 999px radius renders a full circle. */
	#amc-chatbot-root .amc-chatbot-launcher {
		display: flex;
		width: 52px;
		height: 52px;
		min-width: 52px;
		min-height: 52px;
		max-width: 52px;
		max-height: 52px;
		padding: 0;
		gap: 0;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		right: calc(16px + env(safe-area-inset-right, 0px));
	}
	#amc-chatbot-root .amc-chatbot-launcher-label {
		display: none;
	}
	#amc-chatbot-root .amc-chatbot-launcher.is-open {
		display: none;
	}
	#amc-chatbot-root .amc-chatbot-launcher svg {
		width: 24px;
		height: 24px;
		max-width: 24px;
		max-height: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.amc-chatbot-panel,
	.amc-chatbot-launcher,
	.amc-chatbot-typing span,
	.amc-chatbot-msg-bot.amc-chatbot-streaming .amc-chatbot-msg-content::after {
		transition: none;
		animation: none;
	}
}
