/* Skift farverne her, så de passer til hjemmesiden */
.ecmc {
	--ecmc-main: #233a8b;      /* knap, header og dine beskeder */
	--ecmc-main-text: #ffffff; /* tekst oven på hovedfarven */
	--ecmc-bg: #ffffff;        /* baggrund i chatvinduet */
	--ecmc-bot-bg: #eef1f8;    /* baggrund på chatbottens svar */
	--ecmc-text: #1c2233;
	--ecmc-muted: #5d6478;
	--ecmc-bottom: 24px;       /* afstand fra bunden, hæv hvis den rammer en anden knap */
	--ecmc-side: 24px;

	position: fixed;
	right: var(--ecmc-side);
	bottom: var(--ecmc-bottom);
	z-index: 99999;
	font-family: inherit;
	color: var(--ecmc-text);
}

.ecmc *,
.ecmc *::before,
.ecmc *::after { box-sizing: border-box; }

.ecmc-sr {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}

/* Knappen nederst i hjørnet */
.ecmc-launch {
	display: flex; align-items: center; gap: 10px;
	margin-left: auto;
	padding: 10px 18px 10px 10px;
	border: 0; border-radius: 999px;
	background: var(--ecmc-main); color: var(--ecmc-main-text);
	font: inherit; font-size: 15px; font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(35, 58, 139, .28);
}
.ecmc-launch-icon { width: 34px; height: 34px; display: block; }
.ecmc-launch-icon svg {
	width: 100%; height: 100%;
	transform-origin: 50% 45%;
	transition: transform 1.4s cubic-bezier(.34, 1.3, .64, 1);
}
/* Logoet drejer rundt ved hover og ender med én cirkel øverst */
.ecmc-launch:hover .ecmc-launch-icon svg,
.ecmc-launch:focus-visible .ecmc-launch-icon svg { transform: rotate(540deg); }
@media (prefers-reduced-motion: reduce) {
	.ecmc-launch-icon svg { transition: none; }
}
.ecmc-launch-icon circle { fill: rgba(255, 255, 255, .5); }
.ecmc.is-open .ecmc-launch-text { display: none; }
.ecmc.is-open .ecmc-launch { padding: 10px; }

/* Chatvinduet */
.ecmc-panel {
	position: absolute; right: 0; bottom: 64px;
	width: 370px; height: 540px; max-height: calc(100vh - 120px);
	display: flex; flex-direction: column;
	background: var(--ecmc-bg);
	border-radius: 18px;
	box-shadow: 0 18px 50px rgba(20, 30, 70, .22);
	overflow: hidden;
}
.ecmc-panel[hidden] { display: none; }

.ecmc-head {
	display: flex; justify-content: space-between; align-items: flex-start;
	padding: 18px 18px 14px;
	background: var(--ecmc-main); color: var(--ecmc-main-text);
}
.ecmc-title { margin: 0; font-size: 18px; line-height: 1.2; color: inherit; }
.ecmc-sub { margin: 4px 0 0; font-size: 13px; opacity: .8; }
.ecmc-close {
	border: 0; background: transparent; color: inherit;
	font-size: 26px; line-height: 1; padding: 0 4px; cursor: pointer;
}

.ecmc-log {
	flex: 1; overflow-y: auto;
	padding: 16px; display: flex; flex-direction: column; gap: 10px;
}

.ecmc-msg {
	max-width: 85%;
	padding: 10px 14px;
	font-size: 15px; line-height: 1.45;
	white-space: pre-wrap; overflow-wrap: anywhere;
}
.ecmc-bot {
	align-self: flex-start;
	background: var(--ecmc-bot-bg);
	border-radius: 4px 16px 16px 16px;
}
.ecmc-user {
	align-self: flex-end;
	background: var(--ecmc-main); color: var(--ecmc-main-text);
	border-radius: 16px 4px 16px 16px;
}
.ecmc-msg a { color: inherit; text-decoration: underline; }

/* De tre cirkler pulserer, mens svaret bliver skrevet */
.ecmc-typing { display: flex; gap: 5px; padding: 14px; }
.ecmc-typing span {
	width: 8px; height: 8px; border-radius: 50%;
	background: var(--ecmc-main); opacity: .3;
	animation: ecmc-pulse 1.2s infinite;
}
.ecmc-typing span:nth-child(2) { animation-delay: .2s; }
.ecmc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes ecmc-pulse { 40% { opacity: 1; } }

.ecmc-chips {
	display: flex; flex-wrap: wrap; gap: 6px;
	padding: 0 16px;
}
.ecmc-chips:not(:empty) { padding-bottom: 10px; }
.ecmc-chip {
	border: 1px solid var(--ecmc-main); background: transparent;
	color: var(--ecmc-main);
	border-radius: 999px; padding: 6px 12px;
	font: inherit; font-size: 13px; cursor: pointer;
}
.ecmc-chip:hover { background: var(--ecmc-main); color: var(--ecmc-main-text); }

.ecmc-form {
	display: flex; gap: 8px; align-items: flex-end;
	padding: 10px 12px; border-top: 1px solid #e3e6ee;
}
.ecmc-input {
	flex: 1; resize: none;
	border: 1px solid #d5d9e3; border-radius: 12px;
	padding: 10px 12px; margin: 0;
	font: inherit; font-size: 15px; line-height: 1.35;
	color: var(--ecmc-text); background: #fff;
}
.ecmc-send {
	border: 0; border-radius: 12px; padding: 10px 16px;
	background: var(--ecmc-main); color: var(--ecmc-main-text);
	font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.ecmc-send:disabled { opacity: .5; cursor: default; }

.ecmc-note {
	margin: 0; padding: 0 14px 10px;
	font-size: 11px; color: var(--ecmc-muted);
}

.ecmc button:focus-visible,
.ecmc textarea:focus-visible,
.ecmc a:focus-visible {
	outline: 2px solid var(--ecmc-main); outline-offset: 2px;
}
.ecmc-head .ecmc-close:focus-visible { outline-color: var(--ecmc-main-text); }

/* Mobil */
@media (max-width: 480px) {
	.ecmc { --ecmc-side: 14px; --ecmc-bottom: 14px; }
	.ecmc-panel {
		position: fixed; left: 8px; right: 8px; bottom: 80px;
		width: auto; height: 72vh;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ecmc-typing span { animation: none; opacity: .6; }
}
