@import url("https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap");

:root {
	--dkf-radius-lg: 24px;
	--dkf-radius-md: 16px;
	--dkf-radius-sm: 12px;
	--dkf-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
	--dkf-shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
	--dkf-bg: #eef6f5;
	--dkf-surface: rgba(255, 255, 255, 0.94);
	--dkf-surface-strong: #ffffff;
	--dkf-panel-border: rgba(15, 118, 110, 0.14);
	--dkf-text: #102a43;
	--dkf-muted: #5b7083;
	--dkf-accent: #0f766e;
	--dkf-accent-strong: #115e59;
	--dkf-accent-soft: #dff7f3;
	--dkf-user-bubble: linear-gradient(135deg, #0f766e, #0a7c95);
	--dkf-backdrop: radial-gradient(circle at top, rgba(15, 118, 110, 0.14), transparent 38%), linear-gradient(180deg, #f7fbfb 0%, #eef6f5 100%);
	font-family: "Ubuntu", sans-serif;
}

@media (prefers-color-scheme: dark) {
	:root {
		--dkf-bg: #08131a;
		--dkf-surface: rgba(10, 22, 30, 0.95);
		--dkf-surface-strong: #10212b;
		--dkf-panel-border: rgba(87, 225, 197, 0.12);
		--dkf-text: #edf6f8;
		--dkf-muted: #9ab0bc;
		--dkf-accent-soft: rgba(15, 118, 110, 0.18);
		--dkf-backdrop: radial-gradient(circle at top, rgba(18, 154, 139, 0.22), transparent 34%), linear-gradient(180deg, #0b1820 0%, #08131a 100%);
		--dkf-shadow: 0 28px 70px rgba(2, 8, 23, 0.58);
		--dkf-shadow-soft: 0 10px 30px rgba(2, 8, 23, 0.34);
	}
}

.dkf-ai-shell,
.dkf-ai-shell * {
	box-sizing: border-box;
	font-family: "Ubuntu", sans-serif;
}

.dkf-ai-shell.floating {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 99999;
	pointer-events: none;
}

.dkf-ai-shell.floating.dkf-ai-position-left {
	left: 22px;
	right: auto;
}

.dkf-ai-toggle {
	position: relative;
	z-index: 3;
	border: 0;
	border-radius: 999px;
	background:
		radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.34), transparent 34%),
		linear-gradient(135deg, #0f766e 0%, #155e75 48%, #1d4ed8 100%);
	color: #fff;
	width: 68px;
	height: 68px;
	padding: 0;
	font-weight: 700;
	letter-spacing: 0.01em;
	box-shadow: var(--dkf-shadow);
	cursor: pointer;
	pointer-events: auto;
	transition: transform .24s ease, box-shadow .24s ease, opacity .24s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	outline: none;
}

.dkf-ai-shell.dkf-ai-button-pill .dkf-ai-toggle {
	border-radius: 999px;
}

.dkf-ai-shell.dkf-ai-button-square .dkf-ai-toggle {
	border-radius: 18px;
}

.dkf-ai-toggle:hover,
.dkf-ai-toggle:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 34px 72px rgba(15, 23, 42, 0.24);
}

.dkf-ai-toggle.is-open {
	opacity: 0.94;
}

.dkf-ai-toggle-icon {
	position: relative;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.dkf-ai-toggle-svg {
	width: 36px;
	height: 36px;
	display: block;
	filter: drop-shadow(0 6px 14px rgba(255, 255, 255, 0.16));
}

.dkf-ai-toggle-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.dkf-ai-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(8, 19, 26, 0.22);
	backdrop-filter: blur(5px);
	border: 0;
	opacity: 0;
	pointer-events: auto;
	transition: opacity .26s ease;
}

.dkf-ai-backdrop.is-open {
	opacity: 1;
}

.dkf-ai-panel {
	position: relative;
	z-index: 2;
	width: min(94vw, 430px);
	height: min(82vh, 720px);
	background: var(--dkf-surface);
	color: var(--dkf-text);
	border: 1px solid var(--dkf-panel-border);
	border-radius: var(--dkf-radius-lg);
	box-shadow: var(--dkf-shadow);
	margin-bottom: 14px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	backdrop-filter: blur(16px);
	pointer-events: auto;
	transform-origin: bottom right;
	opacity: 0;
	transform: translateY(18px) scale(.92);
	transition: transform .26s cubic-bezier(.22, 1, .36, 1), opacity .24s ease;
	min-height: 0;
}

.dkf-ai-panel::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 120px;
	background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.34), transparent 44%);
	pointer-events: none;
}

.dkf-ai-panel.is-open {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.dkf-ai-panel.is-closing {
	opacity: 0;
	transform: translateY(18px) scale(.92);
}

.dkf-ai-shell.embedded {
	width: 100%;
}

.dkf-ai-shell.embedded .dkf-ai-panel {
	width: 100%;
	min-height: 620px;
	margin: 0;
}

.dkf-ai-header {
	padding: 20px 20px 16px;
	background: linear-gradient(135deg, var(--dkf-accent-strong) 0%, #164e63 52%, #1e40af 100%);
	color: #fff;
}

.dkf-ai-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.dkf-ai-title-copy {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
	min-width: 0;
}

.dkf-ai-title strong {
	font-size: 18px;
	line-height: 1.2;
	letter-spacing: -0.01em;
	display: block;
	overflow-wrap: anywhere;
}

.dkf-ai-badge {
	display: inline-flex;
	align-items: center;
	width: fit-content;
	padding: 6px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.dkf-ai-close {
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	color: #ffffff;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .2s ease, transform .2s ease;
}

.dkf-ai-close:hover,
.dkf-ai-close:focus-visible {
	background: rgba(255, 255, 255, 0.22);
	transform: rotate(90deg);
}

.dkf-ai-tagline {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.86);
}

.dkf-ai-messages {
	flex: 1;
	overflow-y: auto;
	padding: 20px 18px 16px;
	background: var(--dkf-backdrop);
	min-height: 0;
	-webkit-overflow-scrolling: touch;
}

.dkf-ai-msg {
	max-width: 88%;
	padding: 13px 14px;
	border-radius: 18px;
	margin-bottom: 14px;
	line-height: 1.55;
	font-size: 14px;
	white-space: pre-wrap;
	box-shadow: var(--dkf-shadow-soft);
}

.dkf-ai-msg.user {
	margin-left: auto;
	border-bottom-right-radius: 6px;
	background: var(--dkf-user-bubble);
	color: #fff;
}

.dkf-ai-msg.assistant {
	border-bottom-left-radius: 6px;
	background: var(--dkf-surface-strong);
	color: var(--dkf-text);
}

.dkf-ai-sources {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.dkf-ai-sources a {
	display: inline-flex;
	align-items: center;
	padding: 5px 9px;
	border-radius: 999px;
	background: rgba(15, 118, 110, 0.08);
	color: var(--dkf-accent-strong);
	font-size: 11px;
	font-weight: 600;
	text-decoration: none;
}

.dkf-ai-sources a:hover,
.dkf-ai-sources a:focus-visible {
	text-decoration: underline;
}

.dkf-ai-typing {
	padding: 0 18px 12px;
	font-size: 12px;
	font-weight: 500;
	color: var(--dkf-muted);
}

.dkf-ai-composer-wrap {
	padding: 10px 12px;
	background: var(--dkf-surface-strong);
	border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.dkf-ai-quick-replies {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}

.dkf-ai-quick-reply,
.dkf-ai-language-select {
	border: 1px solid rgba(15, 118, 110, 0.16);
	background: #fff;
	color: var(--dkf-text);
	border-radius: 999px;
	padding: 8px 12px;
	font-size: 12px;
}

.dkf-ai-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 10px;
}

.dkf-ai-language-label {
	font-size: 12px;
	color: var(--dkf-muted);
}

.dkf-ai-feedback {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.dkf-ai-feedback-btn {
	border: 1px solid rgba(15, 118, 110, 0.18);
	background: rgba(255, 255, 255, 0.88);
	color: var(--dkf-text);
	border-radius: 999px;
	padding: 6px 10px;
	font-size: 12px;
	cursor: pointer;
}

.dkf-ai-feedback-btn.is-active {
	background: var(--dkf-accent-soft);
	border-color: var(--dkf-accent);
}

.dkf-ai-feedback-note {
	display: inline-flex;
	align-items: center;
	color: var(--dkf-muted);
	font-size: 12px;
}

.dkf-ai-faq-sync {
	display: grid;
	gap: 12px;
}

.dkf-ai-faq-item {
	border: 1px solid var(--dkf-panel-border);
	background: rgba(255, 255, 255, 0.9);
	border-radius: var(--dkf-radius-md);
	padding: 14px 16px;
}

.dkf-ai-faq-item summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--dkf-text);
}

.dkf-ai-composer {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
	align-items: stretch;
}

.dkf-ai-composer input,
.dkf-ai-lead input {
	width: 100%;
	border: 1px solid rgba(148, 163, 184, 0.5);
	border-radius: var(--dkf-radius-md);
	padding: 10px 12px;
	font-size: 13px;
	background: rgba(255, 255, 255, 0.92);
	color: var(--dkf-text);
	outline: none;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.dkf-ai-composer input:focus,
.dkf-ai-lead input:focus {
	border-color: rgba(15, 118, 110, 0.6);
	box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
	transform: translateY(-1px);
}

.dkf-ai-composer button,
.dkf-ai-lead button {
	border: 0;
	border-radius: var(--dkf-radius-md);
	background: linear-gradient(135deg, var(--dkf-accent), #0f5f8c);
	color: #fff;
	padding: 0;
	width: 42px;
	min-width: 42px;
	height: 42px;
	font-weight: 700;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
	box-shadow: 0 12px 24px rgba(15, 118, 110, 0.22);
}

.dkf-ai-composer button:hover,
.dkf-ai-lead button:hover,
.dkf-ai-composer button:focus-visible,
.dkf-ai-lead button:focus-visible {
	transform: translateY(-1px);
}

.dkf-ai-composer button:disabled {
	opacity: 0.7;
	cursor: wait;
}

.dkf-ai-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding-top: 8px;
}

.dkf-ai-secondary-button {
	border: 1px solid rgba(15, 118, 110, 0.16);
	border-radius: 999px;
	background: rgba(15, 118, 110, 0.06);
	color: var(--dkf-accent-strong);
	padding: 8px 12px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background .2s ease, transform .2s ease, border-color .2s ease;
}

.dkf-ai-secondary-button:hover,
.dkf-ai-secondary-button:focus-visible {
	background: rgba(15, 118, 110, 0.1);
	border-color: rgba(15, 118, 110, 0.26);
	transform: translateY(-1px);
}

.dkf-ai-lead {
	display: grid;
	grid-template-columns: 1fr 1fr auto;
	gap: 8px;
	padding: 10px 12px 12px;
	background: linear-gradient(180deg, rgba(15, 118, 110, 0.06), rgba(15, 118, 110, 0.02));
	border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.dkf-ai-lead-wrap {
	background: linear-gradient(180deg, rgba(15, 118, 110, 0.06), rgba(15, 118, 110, 0.02));
	border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.dkf-ai-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 0 12px 10px;
	font-size: 12px;
	line-height: 1.45;
	color: var(--dkf-muted);
}

.dkf-ai-consent input {
	margin-top: 2px;
	flex-shrink: 0;
}

.dkf-ai-lead-error {
	padding: 0 12px 10px;
	font-size: 12px;
	font-weight: 500;
	color: #b91c1c;
}

.dkf-ai-action-icon {
	width: 18px;
	height: 18px;
	display: block;
}

.dkf-ai-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 14px 14px;
	background: var(--dkf-surface-strong);
}

.dkf-ai-powered {
	font-size: 12px;
	font-weight: 500;
	color: var(--dkf-muted);
	text-decoration: none;
	transition: color .2s ease, opacity .2s ease;
}

.dkf-ai-powered:hover,
.dkf-ai-powered:focus-visible {
	color: var(--dkf-accent-strong);
	text-decoration: underline;
}

.dkf-ai-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 700;
	color: var(--dkf-accent-strong);
}

.dkf-ai-status::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: #10b981;
	box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.12);
}

@media (max-width: 640px) {
	.dkf-ai-shell.floating {
		right: 0;
		left: 0;
		bottom: 0;
		display: flex;
		flex-direction: column;
		align-items: flex-end;
	}

	.dkf-ai-panel {
		width: calc(100% - 24px);
		height: min(78dvh, 680px);
		max-height: min(78dvh, 680px);
		margin: 0 12px 12px;
		border-radius: 22px;
		transform-origin: bottom center;
	}

	.dkf-ai-header {
		position: sticky;
		top: 0;
		z-index: 3;
		padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 10px;
		backdrop-filter: blur(10px);
	}

	.dkf-ai-title {
		gap: 10px;
		margin-bottom: 8px;
		align-items: flex-start;
	}

	.dkf-ai-title strong {
		font-size: 15px;
		line-height: 1.25;
	}

	.dkf-ai-badge {
		padding: 4px 8px;
		font-size: 9px;
		letter-spacing: 0.06em;
	}

	.dkf-ai-close {
		flex-shrink: 0;
		width: 34px;
		height: 34px;
	}

	.dkf-ai-tagline {
		font-size: 11px;
		line-height: 1.4;
		max-width: 92%;
	}

	.dkf-ai-messages {
		padding: 16px 14px 12px;
	}

	.dkf-ai-msg {
		max-width: 94%;
		padding: 12px 13px;
		font-size: 13px;
		line-height: 1.5;
		margin-bottom: 10px;
	}

	.dkf-ai-lead {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
		padding: 10px 12px 8px;
	}

	.dkf-ai-composer {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.dkf-ai-composer-wrap {
		padding: 9px 10px;
	}

	.dkf-ai-actions {
		padding-top: 7px;
	}

	.dkf-ai-composer input,
	.dkf-ai-lead input {
		padding: 9px 11px;
		font-size: 14px;
	}

	.dkf-ai-composer button,
	.dkf-ai-lead button {
		width: 40px;
		min-width: 40px;
		height: 40px;
	}

	.dkf-ai-toggle {
		width: 62px;
		height: 62px;
	}

	.dkf-ai-meta {
		flex-direction: column;
		align-items: flex-start;
		padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
		gap: 8px;
	}
}

@media (max-width: 480px) {
	.dkf-ai-panel {
		width: calc(100% - 20px);
		height: min(76dvh, 620px);
		max-height: min(76dvh, 620px);
		margin: 0 10px 10px;
		border-radius: 20px;
	}

	.dkf-ai-header {
		padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 9px;
	}

	.dkf-ai-title strong {
		font-size: 14px;
	}

	.dkf-ai-tagline {
		font-size: 10px;
		line-height: 1.35;
		max-width: 100%;
	}

	.dkf-ai-composer-wrap {
		padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	}
}
