.prosvet-chatbot {
	/* Палитра под тему сайта art-prosvet.ru */
	--pcb-accent: #ffb400;
	--pcb-accent-contrast: #ffffff;
	--pcb-bg: #f4f4f4;
	--pcb-bot-bg: #ffffff;
	--pcb-bot-text: #333333;
	--pcb-window-bg: #ffffff;
	--pcb-border: rgba(34, 34, 34, .12);
	--pcb-radius: 8px;
	--pcb-shadow: 0 5px 30px rgba(34, 34, 34, .14);
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.prosvet-chatbot * {
	box-sizing: border-box;
}

.pcb-launcher {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: var(--pcb-accent);
	color: var(--pcb-accent-contrast);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 24px rgba(34, 34, 34, .22);
	transition: transform .2s ease, opacity .25s ease;
}

.pcb-launcher:hover {
	transform: scale(1.06);
}

/* Кнопка скрыта по просьбе клиента на время */
.prosvet-chatbot.pcb-hidden-launcher .pcb-launcher {
	display: none;
}

/* Кнопка ещё не появилась (задержка показа) */
.prosvet-chatbot.pcb-launch-pending .pcb-launcher {
	opacity: 0;
	transform: scale(.6);
	pointer-events: none;
}

.pcb-window {
	position: absolute;
	right: 0;
	bottom: 74px;
	width: 360px;
	max-width: calc(100vw - 40px);
	height: 540px;
	max-height: calc(100vh - 120px);
	background: var(--pcb-window-bg);
	border-radius: 16px;
	box-shadow: var(--pcb-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	/* По умолчанию скрыто с анимацией. Видимость — через класс .pcb-open на корне. */
	opacity: 0;
	visibility: hidden;
	transform: translateY(14px) scale(.98);
	transform-origin: bottom right;
	pointer-events: none;
	transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

.prosvet-chatbot.pcb-open .pcb-window {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.pcb-header {
	background: var(--pcb-accent);
	color: var(--pcb-accent-contrast);
	padding: 12px 14px;
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

.pcb-title {
	font-weight: 600;
	font-size: 15px;
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pcb-messengers {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 5px;
}

.pcb-msgr {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 7px;
	border-radius: 13px;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	transition: transform .12s ease, opacity .12s ease;
}

.pcb-msgr:hover {
	transform: scale(1.08);
	opacity: .92;
}

.pcb-msgr svg {
	display: block;
}

.pcb-msgr--vk { background: #0077ff; }
.pcb-msgr--tg { background: #29a9eb; }
.pcb-msgr--max { background: #7b4dff; }

.pcb-close {
	background: none;
	border: none;
	color: var(--pcb-accent-contrast);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	opacity: .85;
}

.pcb-close:hover {
	opacity: 1;
}

.pcb-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 14px;
	background: var(--pcb-bg);
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pcb-msg {
	max-width: 85%;
	padding: 9px 12px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.4;
	word-wrap: break-word;
	white-space: pre-wrap;
}

.pcb-anim {
	animation: pcb-msg-in .28s ease both;
}

.pcb-window.pcb-flash {
	animation: pcb-flash 1s ease;
}

@keyframes pcb-flash {
	0% { box-shadow: 0 0 0 0 var(--pcb-accent); }
	40% { box-shadow: 0 0 0 4px var(--pcb-accent), var(--pcb-shadow); }
	100% { box-shadow: var(--pcb-shadow); }
}

@keyframes pcb-msg-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

.pcb-msg--user {
	align-self: flex-end;
	background: var(--pcb-accent);
	color: var(--pcb-accent-contrast);
	border-bottom-right-radius: 4px;
}

.pcb-msg--bot {
	align-self: flex-start;
	background: var(--pcb-bot-bg);
	color: var(--pcb-bot-text);
	border: 1px solid var(--pcb-border);
	border-bottom-left-radius: 4px;
}

.pcb-msg--bot a {
	color: var(--pcb-accent);
	text-decoration: underline;
	word-break: break-word;
}

.pcb-typing {
	align-self: flex-start;
	display: inline-flex;
	gap: 4px;
	padding: 10px 14px;
	background: var(--pcb-bot-bg);
	border: 1px solid var(--pcb-border);
	border-radius: 14px;
}

.pcb-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #b7b7c8;
	animation: pcb-blink 1.2s infinite ease-in-out;
}

.pcb-typing span:nth-child(2) { animation-delay: .2s; }
.pcb-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes pcb-blink {
	0%, 80%, 100% { opacity: .3; }
	40% { opacity: 1; }
}

.pcb-products {
	align-self: flex-start;
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
}

.pcb-card {
	display: flex;
	gap: 10px;
	padding: 8px;
	background: var(--pcb-bot-bg);
	border: 1px solid var(--pcb-border);
	border-radius: var(--pcb-radius);
	text-decoration: none;
	color: var(--pcb-bot-text);
	transition: border-color .15s ease;
}

.pcb-card:hover {
	border-color: var(--pcb-accent);
}

.pcb-card img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 8px;
	flex: 0 0 auto;
	background: #f0f0f5;
}

.pcb-card__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
}

.pcb-card__name {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.pcb-card__price {
	font-size: 13px;
	color: var(--pcb-accent);
	font-weight: 600;
	margin-top: 2px;
}

.pcb-quick {
	flex: 0 0 auto;
	padding: 10px 12px 14px;
	max-height: 220px;
	overflow: hidden;
	opacity: 1;
	transition: max-height .3s ease, opacity .25s ease, padding .3s ease;
}

.pcb-quick-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.pcb-quick-label {
	font-size: 11px;
	color: #9aa1a9;
}

.pcb-quick-close {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border: none;
	background: transparent;
	color: #9aa1a9;
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.pcb-quick-close:hover {
	background: rgba(34, 34, 34, .08);
	color: var(--pcb-bot-text);
}

.pcb-quick-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

/* Свёрнутое состояние — тонкая полоска со стрелкой вверх */
.pcb-quick-toggle {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 18px;
	margin: 0;
	padding: 0;
	border: none;
	border-top: 1px solid var(--pcb-border);
	background: transparent;
	color: var(--pcb-accent);
	cursor: pointer;
}

.pcb-quick-toggle:hover {
	background: rgba(34, 34, 34, .04);
}

.pcb-quick-toggle.pcb-hidden {
	display: none;
}

.pcb-quick.pcb-quick-hidden {
	max-height: 0;
	opacity: 0;
	padding-top: 0;
	padding-bottom: 0;
	pointer-events: none;
}

.pcb-quick button {
	border: 1px solid var(--pcb-accent);
	color: var(--pcb-accent);
	background: #fff;
	border-radius: 16px;
	padding: 5px 12px;
	font-size: 13px;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

.pcb-quick button:hover {
	background: var(--pcb-accent);
	color: var(--pcb-accent-contrast);
}

.pcb-form {
	flex: 0 0 auto;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--pcb-border);
	background: var(--pcb-window-bg);
}

.pcb-input {
	flex: 1 1 auto;
	border: 1px solid var(--pcb-border);
	border-radius: 18px;
	padding: 9px 14px;
	font-size: 14px;
	resize: none;
	max-height: 120px;
	outline: none;
	font-family: inherit;
	background: var(--pcb-bot-bg);
	color: var(--pcb-bot-text);
}

.pcb-input:focus {
	border-color: var(--pcb-accent);
}

.pcb-send {
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	border: none;
	border-radius: 50%;
	background: var(--pcb-accent);
	color: var(--pcb-accent-contrast);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pcb-send:disabled {
	opacity: .5;
	cursor: default;
}
