.kochatbot {
	box-sizing: border-box;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.45;
	color: #1c2421;
}

.kochatbot *,
.kochatbot *::before,
.kochatbot *::after {
	box-sizing: border-box;
}

.kochatbot__toggle,
.kochatbot__close,
.kochatbot__send,
.kochatbot__input {
	font: inherit;
}

.kochatbot:not(.kochatbot--inline) {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 99990;
}

.kochatbot__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 112px;
	min-height: 48px;
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	background: #143d33;
	color: #f4f7f5;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(20, 40, 32, 0.24);
}

.kochatbot__toggle:hover,
.kochatbot__toggle:focus-visible {
	background: #0f5c4c;
}

.kochatbot__panel[hidden] {
	display: none;
}

.kochatbot__panel:not([hidden]) {
	display: flex;
	flex-direction: column;
	width: min(380px, calc(100vw - 32px));
	max-height: min(640px, calc(100vh - 96px));
	margin-bottom: 12px;
	padding: 16px;
	border: 1px solid #d5ddd8;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 16px 40px rgba(20, 40, 32, 0.16);
}

@media (max-width: 960px) {
	.kochatbot:not(.kochatbot--inline):not(.kochatbot--opened) .kochatbot__panel {
		display: none;
	}
}

.kochatbot--inline .kochatbot__panel {
	width: 100%;
	max-width: 720px;
	max-height: none;
	margin: 0;
}

.kochatbot__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.kochatbot__close {
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #1c2421;
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
}

.kochatbot__privacy {
	margin: 0 0 12px;
	color: #4d5b55;
	font-size: 13px;
}

.kochatbot__privacy a {
	color: #0f5c4c;
	text-decoration: underline;
}

.kochatbot__log {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-height: 48px;
	max-height: 320px;
	overflow: auto;
	margin-bottom: 12px;
}

.kochatbot__bubble {
	margin: 0;
	padding: 10px 12px;
	border-radius: 12px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.kochatbot__bubble--user {
	align-self: flex-end;
	max-width: 85%;
	background: #e7f2ee;
}

.kochatbot__bubble--bot {
	align-self: stretch;
	background: #f6f7f8;
}

.kochatbot__sources {
	margin: 8px 0 0;
	padding-left: 18px;
}

.kochatbot__sources a {
	color: #0f5c4c;
}

.kochatbot__form {
	display: flex;
	gap: 8px;
	align-items: center;
}

.kochatbot__label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.kochatbot__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.kochatbot__input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid #c5d0cb;
	border-radius: 10px;
	background: #fff;
	color: #1c2421;
}

.kochatbot__send {
	flex: 0 0 auto;
	min-height: 44px;
	padding: 0 14px;
	border: 0;
	border-radius: 10px;
	background: #143d33;
	color: #f4f7f5;
	cursor: pointer;
}

.kochatbot__send:disabled,
.kochatbot__input:disabled {
	opacity: 0.6;
	cursor: progress;
}

.kochatbot__toggle:focus-visible,
.kochatbot__close:focus-visible,
.kochatbot__send:focus-visible,
.kochatbot__input:focus-visible {
	outline: 2px solid #0f5c4c;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.kochatbot__toggle,
	.kochatbot__panel {
		scroll-behavior: auto;
	}
}
