:root {
	--kammak-ai-ink: #2f2924;
	--kammak-ai-muted: #726960;
	--kammak-ai-paper: #fffdf9;
	--kammak-ai-warm: #f4eee5;
	--kammak-ai-accent: #8b6545;
	--kammak-ai-accent-dark: #68482f;
	--kammak-ai-line: #ded4c8;
	--kammak-ai-error: #9b332d;
}

.kammak-ai,
.kammak-ai * {
	box-sizing: border-box;
}

.kammak-ai {
	color: var(--kammak-ai-ink);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
}

.kammak-ai .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.kammak-ai--floating {
	bottom: max(22px, env(safe-area-inset-bottom));
	position: fixed;
	right: max(22px, env(safe-area-inset-right));
	z-index: 99990;
}

.kammak-ai__launcher {
	align-items: center;
	background: var(--kammak-ai-ink);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 50%;
	box-shadow: 0 12px 32px rgba(47, 41, 36, 0.24);
	color: #fff;
	cursor: pointer;
	display: flex;
	font-size: 23px;
	height: 58px;
	justify-content: center;
	transition: transform 160ms ease, background 160ms ease;
	width: 58px;
}

.kammak-ai__launcher:hover {
	background: var(--kammak-ai-accent-dark);
	transform: translateY(-2px);
}

.kammak-ai__launcher:focus-visible,
.kammak-ai button:focus-visible,
.kammak-ai a:focus-visible,
.kammak-ai input:focus-visible,
.kammak-ai textarea:focus-visible {
	outline: 3px solid rgba(139, 101, 69, 0.42);
	outline-offset: 2px;
}

.kammak-ai__panel {
	background: var(--kammak-ai-paper);
	border: 1px solid var(--kammak-ai-line);
	border-radius: 18px;
	box-shadow: 0 22px 60px rgba(47, 41, 36, 0.2);
	display: flex;
	flex-direction: column;
	height: min(690px, calc(100vh - 120px));
	overflow: hidden;
	width: min(400px, calc(100vw - 32px));
}

.kammak-ai--floating .kammak-ai__panel {
	bottom: 72px;
	position: absolute;
	right: 0;
}

.kammak-ai--embedded {
	margin: 24px auto;
	max-width: 720px;
}

.kammak-ai--embedded .kammak-ai__panel {
	height: min(720px, 80vh);
	width: 100%;
}

.kammak-ai__panel[hidden],
.kammak-ai__handoff[hidden] {
	display: none !important;
}

.kammak-ai__header {
	align-items: center;
	background: linear-gradient(135deg, #f4eee5, #fbf7f1);
	border-bottom: 1px solid var(--kammak-ai-line);
	display: flex;
	justify-content: space-between;
	min-height: 72px;
	padding: 15px 18px;
}

.kammak-ai__header strong {
	display: block;
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 18px;
	font-weight: 500;
	letter-spacing: 0.01em;
}

.kammak-ai__status {
	align-items: center;
	color: var(--kammak-ai-muted);
	display: flex;
	font-size: 12px;
	gap: 6px;
	margin-top: 2px;
}

.kammak-ai__status::before {
	background: #bb986f;
	border-radius: 50%;
	content: '';
	height: 7px;
	width: 7px;
}

.kammak-ai__status[data-state='online']::before {
	background: #5d8a69;
}

.kammak-ai__status[data-state='error']::before {
	background: var(--kammak-ai-error);
}

.kammak-ai__close {
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: var(--kammak-ai-muted);
	cursor: pointer;
	font-size: 28px;
	height: 38px;
	line-height: 1;
	padding: 0;
	width: 38px;
}

.kammak-ai__messages {
	background: var(--kammak-ai-paper);
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 12px;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 18px;
	scrollbar-color: #c7b9aa transparent;
}

.kammak-ai__message {
	border-radius: 14px;
	max-width: 88%;
	padding: 10px 13px;
	white-space: pre-wrap;
	word-break: break-word;
}

.kammak-ai__message p,
.kammak-ai__message ul,
.kammak-ai__message ol,
.kammak-ai__message blockquote {
	margin: 0 0 8px;
}

.kammak-ai__message > :last-child,
.kammak-ai__message-content > :last-child {
	margin-bottom: 0;
}

.kammak-ai__message--assistant {
	align-self: flex-start;
	background: var(--kammak-ai-warm);
	border-bottom-left-radius: 4px;
}

.kammak-ai__message--user {
	align-self: flex-end;
	background: var(--kammak-ai-ink);
	border-bottom-right-radius: 4px;
	color: #fff;
}

.kammak-ai__message--error {
	border: 1px solid rgba(155, 51, 45, 0.24);
	color: var(--kammak-ai-error);
}

.kammak-ai__message a {
	color: var(--kammak-ai-accent-dark);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.kammak-ai__products {
	display: grid;
	gap: 9px;
	margin-top: 11px;
}

.kammak-ai__products:empty {
	display: none;
}

.kammak-ai__product {
	background: #fff;
	border: 1px solid var(--kammak-ai-line);
	border-radius: 12px;
	display: grid;
	gap: 11px;
	grid-template-columns: 78px minmax(0, 1fr);
	overflow: hidden;
	padding: 9px;
	white-space: normal;
}

.kammak-ai__product--no-image {
	grid-template-columns: minmax(0, 1fr);
}

.kammak-ai__product > img {
	background: var(--kammak-ai-warm);
	border-radius: 8px;
	height: 78px;
	object-fit: cover;
	width: 78px;
}

.kammak-ai__product-details {
	align-items: flex-start;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.kammak-ai__product-details strong {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

.kammak-ai__product-price {
	color: var(--kammak-ai-accent-dark);
	font-size: 13px;
	font-weight: 700;
	margin-top: 3px;
}

.kammak-ai__product-details p {
	color: var(--kammak-ai-muted);
	font-size: 12px;
	line-height: 1.4;
	margin: 5px 0;
}

.kammak-ai__product-verification {
	color: var(--kammak-ai-muted);
	font-size: 10px;
	line-height: 1.35;
	margin-bottom: 5px;
}

.kammak-ai__citations {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	font-size: 10px;
	gap: 4px 8px;
	margin-top: 9px;
}

.kammak-ai__citations:empty {
	display: none;
}

.kammak-ai__citations span {
	color: var(--kammak-ai-muted);
}

.kammak-ai__product-link {
	color: var(--kammak-ai-accent-dark);
	font-size: 12px;
	font-weight: 700;
	margin-top: auto;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.kammak-ai__tools {
	background: var(--kammak-ai-paper);
	border-top: 1px solid var(--kammak-ai-line);
	padding: 7px 14px 0;
	text-align: right;
}

.kammak-ai__handoff-trigger {
	background: transparent;
	border: 0;
	color: var(--kammak-ai-accent-dark);
	cursor: pointer;
	font-size: 12px;
	padding: 5px;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.kammak-ai__composer {
	align-items: flex-end;
	background: var(--kammak-ai-paper);
	display: flex;
	gap: 8px;
	padding: 10px 14px 12px;
}

.kammak-ai__composer textarea,
.kammak-ai__handoff input,
.kammak-ai__handoff textarea {
	background: #fff;
	border: 1px solid var(--kammak-ai-line);
	border-radius: 11px;
	box-shadow: none;
	color: var(--kammak-ai-ink);
	font: inherit;
}

.kammak-ai__composer textarea {
	flex: 1;
	max-height: 112px;
	min-height: 43px;
	padding: 10px 12px;
	resize: none;
}

.kammak-ai__composer button,
.kammak-ai__primary,
.kammak-ai__secondary {
	border-radius: 10px;
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	min-height: 43px;
	padding: 8px 15px;
}

.kammak-ai__composer button,
.kammak-ai__primary {
	background: var(--kammak-ai-accent);
	border: 1px solid var(--kammak-ai-accent);
	color: #fff;
}

.kammak-ai__secondary {
	background: transparent;
	border: 1px solid var(--kammak-ai-line);
	color: var(--kammak-ai-ink);
}

.kammak-ai button:disabled,
.kammak-ai textarea:disabled {
	cursor: not-allowed;
	opacity: 0.58;
}

.kammak-ai__disclaimer {
	background: var(--kammak-ai-paper);
	color: var(--kammak-ai-muted);
	font-size: 10px;
	margin: 0;
	padding: 0 14px 10px;
	text-align: center;
}

.kammak-ai__handoff {
	background: rgba(47, 41, 36, 0.2);
	inset: 72px 0 0;
	overflow-y: auto;
	padding: 18px;
	position: absolute;
	z-index: 3;
}

.kammak-ai__panel {
	position: relative;
}

.kammak-ai__handoff form {
	background: var(--kammak-ai-paper);
	border: 1px solid var(--kammak-ai-line);
	border-radius: 14px;
	box-shadow: 0 14px 36px rgba(47, 41, 36, 0.16);
	display: grid;
	gap: 11px;
	padding: 17px;
}

.kammak-ai__handoff form > strong {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 17px;
	font-weight: 500;
}

.kammak-ai__handoff label:not(.kammak-ai__consent) {
	display: grid;
	font-size: 12px;
	gap: 4px;
}

.kammak-ai__handoff input,
.kammak-ai__handoff textarea {
	padding: 9px 10px;
	width: 100%;
}

.kammak-ai__consent {
	align-items: flex-start;
	color: var(--kammak-ai-muted);
	display: flex;
	font-size: 11px;
	gap: 7px;
}

.kammak-ai__consent input {
	flex: 0 0 auto;
	margin-top: 3px;
	width: auto;
}

.kammak-ai__consent a {
	color: inherit;
}

.kammak-ai__form-error {
	color: var(--kammak-ai-error);
	font-size: 12px;
}

.kammak-ai__form-error:empty {
	display: none;
}

.kammak-ai__form-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}

@media (max-width: 520px) {
	.kammak-ai--floating {
		bottom: max(12px, env(safe-area-inset-bottom));
		right: max(12px, env(safe-area-inset-right));
	}

	.kammak-ai--floating .kammak-ai__panel {
		bottom: 0;
		position: fixed;
		right: 0;
	}

	.kammak-ai--floating .kammak-ai__panel:not([hidden]) + * {
		display: none;
	}

	.kammak-ai__panel {
		border-radius: 16px 16px 0 0;
		height: calc(100dvh - 18px);
		max-height: none;
		width: 100vw;
	}

	.kammak-ai__launcher[aria-expanded='true'] {
		visibility: hidden;
	}

	.kammak-ai__message {
		max-width: 92%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kammak-ai *,
	.kammak-ai *::before,
	.kammak-ai *::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
