/* dsgn AI Chat – widget styles (scoped under .dsgn-aic) */

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

.dsgn-aic {
	--dsgn-aic-accent: #1d3a6e;
	--dsgn-aic-text: #1a1a1a;
	--dsgn-aic-muted: #4a4f57;
	--dsgn-aic-bg: #ffffff;
	--dsgn-aic-soft: #f4f6f9;
	--dsgn-aic-bot: #eceff4;
	--dsgn-aic-border: #c9ced6;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	color: var(--dsgn-aic-text);
	text-align: left;
}

.dsgn-aic[data-pos="left"] {
	right: auto;
	left: 20px;
}

.dsgn-aic .dsgn-aic-sr {
	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;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Reset theme / Elementor button & field styles inside the widget */
.dsgn-aic button,
.dsgn-aic textarea {
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	margin: 0;
	min-height: 0;
	box-shadow: none;
}

.dsgn-aic button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	line-height: 1;
	cursor: pointer;
}

.dsgn-aic button:focus-visible,
.dsgn-aic textarea:focus-visible,
.dsgn-aic a:focus-visible,
.dsgn-aic .dsgn-aic-log:focus-visible {
	outline: 3px solid var(--dsgn-aic-accent);
	outline-offset: 2px;
}

/* Launcher */
.dsgn-aic .dsgn-aic-toggle {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--dsgn-aic-accent);
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.dsgn-aic .dsgn-aic-toggle:hover,
.dsgn-aic .dsgn-aic-toggle:focus {
	background: var(--dsgn-aic-accent);
	color: #ffffff;
	filter: brightness(1.12);
}

/* Panel */
.dsgn-aic .dsgn-aic-panel {
	position: absolute;
	right: 0;
	bottom: 76px;
	display: flex;
	flex-direction: column;
	width: min(380px, calc(100vw - 40px));
	height: min(560px, calc(100vh - 120px));
	background: var(--dsgn-aic-bg);
	border: 1px solid var(--dsgn-aic-border);
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
	overflow: hidden;
}

.dsgn-aic .dsgn-aic-panel[hidden] {
	display: none;
}

.dsgn-aic[data-pos="left"] .dsgn-aic-panel {
	right: auto;
	left: 0;
}

.dsgn-aic .dsgn-aic-head {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 8px 8px 8px 16px;
	background: var(--dsgn-aic-accent);
	color: #ffffff;
}

.dsgn-aic .dsgn-aic-title {
	flex: 1;
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	color: #ffffff;
}

.dsgn-aic .dsgn-aic-icon-btn {
	width: 44px;
	height: 44px;
	border-radius: 8px;
	background: transparent;
	color: #ffffff;
}

.dsgn-aic .dsgn-aic-icon-btn:hover,
.dsgn-aic .dsgn-aic-icon-btn:focus {
	background: rgba(255, 255, 255, 0.16);
	color: #ffffff;
}

.dsgn-aic .dsgn-aic-icon-btn:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: -3px;
}

.dsgn-aic .dsgn-aic-notice {
	margin: 0;
	padding: 8px 16px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--dsgn-aic-muted);
	background: var(--dsgn-aic-soft);
	border-bottom: 1px solid var(--dsgn-aic-border);
}

.dsgn-aic .dsgn-aic-notice a {
	color: var(--dsgn-aic-text);
	text-decoration: underline;
}

/* Messages */
.dsgn-aic .dsgn-aic-log {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.dsgn-aic .dsgn-aic-msg {
	display: flex;
	max-width: 85%;
}

.dsgn-aic .dsgn-aic-msg--user {
	align-self: flex-end;
}

.dsgn-aic .dsgn-aic-msg--bot {
	align-self: flex-start;
}

.dsgn-aic .dsgn-aic-bubble {
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 15px;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.dsgn-aic .dsgn-aic-msg--bot .dsgn-aic-bubble {
	background: var(--dsgn-aic-bot);
	color: var(--dsgn-aic-text);
	border-bottom-left-radius: 4px;
}

.dsgn-aic .dsgn-aic-msg--user .dsgn-aic-bubble {
	background: var(--dsgn-aic-accent);
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

.dsgn-aic .dsgn-aic-bubble a {
	color: inherit;
	text-decoration: underline;
}

.dsgn-aic .dsgn-aic-msg--error .dsgn-aic-bubble {
	background: #fdecec;
	color: #8a1c1c;
	border: 1px solid #e3a5a5;
}

.dsgn-aic .dsgn-aic-typing {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	padding: 13px 14px;
	background: var(--dsgn-aic-bot);
	border-radius: 14px;
	border-bottom-left-radius: 4px;
}

.dsgn-aic .dsgn-aic-typing span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--dsgn-aic-muted);
	animation: dsgn-aic-blink 1.2s infinite ease-in-out;
}

.dsgn-aic .dsgn-aic-typing span:nth-child(2) {
	animation-delay: 0.2s;
}

.dsgn-aic .dsgn-aic-typing span:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes dsgn-aic-blink {
	0%, 80%, 100% { opacity: 0.3; }
	40% { opacity: 1; }
}

/* Input */
.dsgn-aic .dsgn-aic-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin: 0;
	padding: 10px 12px;
	padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	background: var(--dsgn-aic-bg);
	border-top: 1px solid var(--dsgn-aic-border);
}

.dsgn-aic .dsgn-aic-input {
	flex: 1;
	width: auto;
	min-height: 44px;
	max-height: 120px;
	padding: 10px 12px;
	font-size: 16px; /* prevents iOS zoom */
	line-height: 1.4;
	color: var(--dsgn-aic-text);
	background: #ffffff;
	border: 1px solid #767676;
	border-radius: 10px;
	resize: none;
}

.dsgn-aic .dsgn-aic-input::placeholder {
	color: #646a73;
	opacity: 1;
}

.dsgn-aic .dsgn-aic-send {
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background: var(--dsgn-aic-accent);
	color: #ffffff;
}

.dsgn-aic .dsgn-aic-send:hover,
.dsgn-aic .dsgn-aic-send:focus {
	background: var(--dsgn-aic-accent);
	color: #ffffff;
	filter: brightness(1.12);
}

.dsgn-aic .dsgn-aic-send:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	filter: none;
}

/* Mobile: full-screen panel */
@media (max-width: 480px) {
	.dsgn-aic {
		right: 16px;
		bottom: 16px;
	}

	.dsgn-aic[data-pos="left"] {
		left: 16px;
	}

	.dsgn-aic.is-open .dsgn-aic-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		border: 0;
		border-radius: 0;
	}

	.dsgn-aic.is-open .dsgn-aic-toggle {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dsgn-aic .dsgn-aic-typing span {
		animation: none;
		opacity: 0.7;
	}
}

@media print {
	.dsgn-aic {
		display: none !important;
	}
}
