/* Shared launcher correction: the logo artwork stays complete, sharp and separate from the animated light. */
.da-ai-assistant {
	/* The shared shell is mounted once from wp_footer, so this fixed anchor
	 * applies consistently to every public template. */
	right: calc(22px + env(safe-area-inset-right, 0px) + var(--da-ai-visual-right, 0px));
	left: auto;
	bottom: calc(22px + env(safe-area-inset-bottom, 0px) + var(--da-ai-visual-bottom-inset, 0px));
	overflow: visible;
}

/* This theme does not load WordPress's global screen-reader utility everywhere. */
.da-ai-assistant .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.da-ai-assistant__launcher {
	position: relative;
	display: grid;
	place-items: center;
	width: 88px;
	height: 88px;
	padding: 0;
	overflow: visible;
	border: 2px solid rgba(255, 255, 255, .96);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 4px rgba(30, 131, 239, .18), 0 0 22px rgba(52, 113, 240, .55), 0 0 42px rgba(147, 70, 220, .36), 0 0 64px rgba(220, 45, 183, .24);
	isolation: isolate;
}

/* Elementor's global Theme Style targets every button and otherwise paints
 * this launcher with the site's unrelated CTA gradient and inset shadow.
 * Keep the assistant's approved circular launcher isolated from that rule. */
.da-ai-assistant .da-ai-assistant__launcher {
	border: 2px solid rgba(255, 255, 255, .96);
	border-radius: 50%;
	background-color: #fff;
	background-image: none;
	box-shadow: 0 0 0 4px rgba(30, 131, 239, .18), 0 0 22px rgba(52, 113, 240, .55), 0 0 42px rgba(147, 70, 220, .36), 0 0 64px rgba(220, 45, 183, .24);
}

.da-ai-assistant .da-ai-assistant__launcher:hover {
	border: 2px solid rgba(255, 255, 255, .96);
	background-color: #fff;
	background-image: none;
	box-shadow: 0 0 0 5px rgba(30, 131, 239, .2), 0 0 28px rgba(52, 113, 240, .65), 0 0 52px rgba(147, 70, 220, .42), 0 0 72px rgba(220, 45, 183, .3);
}

.da-ai-assistant .da-ai-assistant__launcher:focus-visible {
	outline: 3px solid #ffcd42;
	outline-offset: 3px;
}

/* Elementor's global button rule also targets the assistant's panel controls.
 * These scoped, higher-specificity rules retain the original assistant UI. */
.da-ai-assistant button {
	letter-spacing: normal;
	text-transform: none;
}

.da-ai-assistant .da-ai-assistant__icon-button {
	border: 0;
	border-radius: 9px;
	background-color: rgba(255, 255, 255, .1);
	background-image: none;
	box-shadow: none;
	color: #fff;
	letter-spacing: normal;
	text-transform: none;
}

.da-ai-assistant .da-ai-assistant__icon-button:hover {
	background-color: rgba(255, 255, 255, .2);
	background-image: none;
	box-shadow: none;
}

.da-ai-assistant .da-ai-assistant__choice,
.da-ai-assistant .da-ai-assistant__choice-action {
	border: 1px solid #b9cbed;
	border-radius: 11px;
	background-color: #fff;
	background-image: none;
	box-shadow: none;
	color: #12366e;
	letter-spacing: normal;
	text-transform: none;
}

.da-ai-assistant .da-ai-assistant__choice:hover,
.da-ai-assistant .da-ai-assistant__choice-action:hover {
	border-color: #1669cb;
	background-color: #edf5ff;
	background-image: none;
	box-shadow: none;
	color: #0a326e;
}

.da-ai-assistant .da-ai-assistant__choice[aria-pressed="true"] {
	border-color: #5c49c7;
	background-color: #ebeaff;
	background-image: none;
	color: #302481;
}

.da-ai-assistant .da-ai-assistant__choice--done {
	border: 1px solid #5542be;
	border-radius: 11px;
	background-color: #5742bd;
	background-image: linear-gradient(110deg, #075fbd, #5742bd 62%, #a52291);
	box-shadow: none;
	color: #fff;
	letter-spacing: normal;
	text-transform: none;
}

.da-ai-assistant .da-ai-assistant__choice--done:hover,
.da-ai-assistant .da-ai-assistant__choice--done:active {
	border-color: #302481;
	background-color: #4935a6;
	background-image: linear-gradient(110deg, #064f9e, #4935a6 62%, #861875);
	color: #fff;
}

.da-ai-assistant .da-ai-assistant__choice--done:disabled,
.da-ai-assistant .da-ai-assistant__choice--done[aria-disabled="true"] {
	border-color: #c5d0e2;
	background-color: #e8eef8;
	background-image: none;
	color: #3c506f;
}

.da-ai-assistant .da-ai-assistant__composer button {
	border: 0;
	border-radius: 12px;
	background-color: #5742bd;
	background-image: linear-gradient(130deg, #075fbd, #5742bd 62%, #a52291);
	box-shadow: none;
	color: #fff;
	letter-spacing: normal;
	text-transform: none;
}

.da-ai-assistant .da-ai-assistant__composer button:disabled {
	background-color: #dce5f2;
	background-image: none;
	box-shadow: none;
	color: #344b6f;
}

.da-ai-assistant .da-ai-assistant__field input:not([type="button"]):not([type="submit"]),
.da-ai-assistant .da-ai-assistant__composer input:not([type="button"]):not([type="submit"]) {
	border: 1px solid #c5d8f7;
	border-radius: 12px;
	background-color: #f9fbff;
	background-image: none;
	box-shadow: none;
	color: #102657;
}

.da-ai-assistant .da-ai-assistant__field input:not([type="button"]):not([type="submit"]):focus,
.da-ai-assistant .da-ai-assistant__composer input:not([type="button"]):not([type="submit"]):focus {
	border-color: #1677ef;
	background-color: #fff;
	background-image: none;
	box-shadow: none;
	color: #102657;
	outline: 3px solid rgba(34, 122, 240, .18);
}

.da-ai-assistant .da-ai-assistant__field input:not([type="button"]):not([type="submit"]) {
	border-radius: 9px;
	font-size: 14px;
}

.da-ai-assistant .da-ai-assistant__composer input:not([type="button"]):not([type="submit"]) {
	font-size: 16px;
}

.da-ai-assistant__launcher::before {
	position: absolute;
	inset: -8px;
	z-index: -1;
	padding: 2px;
	border-radius: inherit;
	background: conic-gradient(from 18deg, #1688f1, #6949dd 37%, #de2eba 65%, #2494f3 88%, #1688f1);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	content: "";
	pointer-events: none;
	animation: da-ai-launcher-ring 6s linear infinite;
}

.da-ai-assistant__launcher::after {
	position: absolute;
	inset: -18px;
	z-index: -2;
	border-radius: inherit;
	background: radial-gradient(circle, rgba(47, 137, 243, .18) 0 40%, rgba(101, 71, 220, .12) 56%, rgba(221, 45, 183, 0) 74%);
	content: "";
	pointer-events: none;
}

.da-ai-assistant__launcher:hover {
	box-shadow: 0 0 0 5px rgba(30, 131, 239, .2), 0 0 28px rgba(52, 113, 240, .65), 0 0 52px rgba(147, 70, 220, .42), 0 0 72px rgba(220, 45, 183, .3);
}

.da-ai-assistant__launcher-mark {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	padding: 5px;
	overflow: hidden;
	border-radius: 50%;
	background: #fff;
}

.da-ai-assistant__launcher-mark img,
.da-ai-assistant__header-logo img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: contain;
	object-position: center;
	transform: none;
}

.da-ai-assistant__availability {
	position: absolute;
	right: 2px;
	bottom: 3px;
	z-index: 2;
	width: 18px;
	height: 18px;
	border: 3px solid #fff;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 2px rgba(22, 119, 239, .45), 0 3px 8px rgba(9, 24, 61, .25);
}

.da-ai-assistant__header-logo {
	overflow: hidden;
}

.da-ai-assistant__panel {
	left: auto;
	right: 0;
	bottom: 106px;
	width: min(408px, calc(var(--da-ai-visual-width, 100vw) - 44px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
}

@keyframes da-ai-launcher-ring {
	to { transform: rotate(1turn); }
}

@media (prefers-reduced-motion: reduce) {
	.da-ai-assistant__launcher::before { animation: none; }
}

@media (max-width: 520px) {
	.da-ai-assistant {
		right: calc(16px + env(safe-area-inset-right, 0px) + var(--da-ai-visual-right, 0px));
		left: auto;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--da-ai-visual-bottom-inset, 0px));
	}

	.da-ai-assistant__launcher {
		width: 76px;
		height: 76px;
	}

	.da-ai-assistant__launcher-mark {
		width: 66px;
		height: 66px;
	}

	.da-ai-assistant__panel {
		left: auto;
		right: 0;
		bottom: 94px;
		width: min(408px, calc(var(--da-ai-visual-width, 100vw) - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
		min-height: 0;
	}
}

/* Reserve the lower-right stack only on pages that actually render the legacy
 * floating WhatsApp control; pages with only the header link stay near-bottom. */
body:has(.da-chat:not([hidden])) .da-ai-assistant {
	bottom: calc(152px + env(safe-area-inset-bottom, 0px) + var(--da-ai-visual-bottom-inset, 0px));
}
@media (max-width: 520px) {
	body:has(.da-chat:not([hidden])) .da-ai-assistant {
		bottom: calc(146px + env(safe-area-inset-bottom, 0px) + var(--da-ai-visual-bottom-inset, 0px));
	}
}

/* In short landscape, use the lower-right corner for the assistant and move
 * WhatsApp to the opposite side so the panel can retain a usable scroll area. */
@media (max-height: 500px) and (min-width: 521px) and (orientation: landscape) {
	.da-ai-assistant {
		bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--da-ai-visual-bottom-inset, 0px));
	}
	body:has(.da-chat:not([hidden])) .da-ai-assistant {
		bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--da-ai-visual-bottom-inset, 0px));
	}
	body:has(.da-chat:not([hidden])) .da-chat {
		left: calc(16px + env(safe-area-inset-left, 0px)) !important;
		right: auto !important;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
	}
}

/* When the software keyboard is open, anchor controls to its visible edge;
 * the WhatsApp button remains behind the keyboard and no longer competes. */
@media (max-width: 520px) {
	.da-ai-assistant--keyboard-open {
		bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--da-ai-visual-bottom-inset, 0px));
	}
	body:has(.da-chat:not([hidden])) .da-ai-assistant--keyboard-open {
		bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--da-ai-visual-bottom-inset, 0px));
	}
}
