.assistant {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 950;
	font-family: var(--font-body);
}

.assistant__launcher {
	position: relative;
	display: grid;
	width: 58px;
	height: 58px;
	place-items: center;
	color: var(--color-surface);
	background: var(--color-brand);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.assistant__launcher:hover {
	background: var(--color-brand-dark);
}

.assistant__launcher:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 4px;
}

.assistant__launcher-icon {
	width: 25px;
	height: 25px;
}

.assistant__launcher-dot {
	position: absolute;
	top: 3px;
	right: 3px;
	width: 13px;
	height: 13px;
	background: #b9d18a;
	border: 2px solid var(--color-brand);
	border-radius: 50%;
}

.assistant__panel {
	position: absolute;
	right: 0;
	bottom: 74px;
	display: flex;
	width: min(380px, calc(100vw - 32px));
	height: min(590px, calc(100dvh - 120px));
	flex-direction: column;
	overflow: hidden;
	background: var(--color-surface);
	border: 1px solid var(--color-line);
	border-radius: 18px;
}

.assistant__panel[hidden] {
	display: none;
}


.assistant__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 15px 16px;
	color: #f7f5ef;
	background: var(--color-brand);
}

.assistant__identity {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.assistant__avatar {
	display: grid;
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	place-items: center;
	color: var(--color-brand);
	background: #edf2e4;
	border-radius: 50%;
}

.assistant__avatar .icon {
	width: 20px;
	height: 20px;
}

.assistant__identity-text {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 1px;
}

.assistant__title {
	font-family: var(--font-display);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.2;
}

.assistant__status {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 10px;
	letter-spacing: 0.02em;
	color: #cfdcc2;
}

.assistant__status::before {
	width: 5px;
	height: 5px;
	background: #b9d18a;
	border-radius: 50%;
	content: "";
}

.assistant__close {
	display: grid;
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	place-items: center;
	color: #e6eddb;
	background: rgb(255 255 255 / 8%);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.assistant__close:hover {
	background: rgb(255 255 255 / 16%);
}

.assistant__messages {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 13px;
	padding: 16px;
	overflow-y: auto;
	background: #f7f5ef;
	scrollbar-width: thin;
	scrollbar-color: #cfd7c2 transparent;
}

.assistant__message {
	display: flex;
	align-items: flex-end;
	gap: 7px;
	max-width: 100%;
}

.assistant__message--user {
	justify-content: flex-end;
}

.assistant__message-avatar {
	display: grid;
	width: 26px;
	height: 26px;
	flex-shrink: 0;
	place-items: center;
	color: var(--color-brand);
	background: #edf2e4;
	border-radius: 50%;
}

.assistant__message-avatar .icon {
	width: 14px;
	height: 14px;
}

.assistant__bubble {
	max-width: 82%;
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.55;
	color: var(--color-ink);
	background: #f0eee3;
	border: 1px solid #e7e4d6;
	border-radius: 4px 14px 14px;
}

.assistant__message--user .assistant__bubble {
	color: var(--color-surface);
	background: var(--color-brand);
	border-color: var(--color-brand);
	border-radius: 14px 4px 14px 14px;
}

.assistant__bubble p {
	margin: 0;
}

.assistant__bubble p + p {
	margin-top: 7px;
}

.assistant__products {
	display: grid;
	gap: 7px;
	margin-top: 10px;
}

.assistant__product {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr) 16px;
	gap: 9px;
	align-items: center;
	padding: 7px;
	color: var(--color-ink);
	text-decoration: none;
	background: var(--color-surface);
	border: 1px solid #e7e4d6;
	border-radius: 9px;
}

.assistant__product:hover {
	color: var(--color-ink);
	border-color: #b9c9a9;
}

.assistant__product img {
	width: 44px;
	height: 48px;
	object-fit: contain;
	background: var(--color-surface-muted);
	border-radius: 5px;
}

.assistant__product-body {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 2px;
}

.assistant__product-name {
	overflow: hidden;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.assistant__product-price {
	font-size: 11px;
	color: var(--color-brand);
}

.assistant__product-arrow {
	font-size: 15px;
	color: #87977a;
}

.assistant__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.assistant__chip {
	min-height: 30px;
	padding: 6px 10px;
	font-family: var(--font-body);
	font-size: 11px;
	line-height: 1.2;
	color: var(--color-brand);
	text-decoration: none;
	background: var(--color-surface);
	border: 1px solid #d7dfcf;
	border-radius: var(--radius-pill);
	cursor: pointer;
}

.assistant__chip:hover {
	color: var(--color-brand);
	background: #edf2e4;
	border-color: #b9c9a9;
}

.assistant__typing {
	display: flex;
	align-items: center;
	gap: 4px;
	width: fit-content;
	padding: 11px 13px;
	background: #f0eee3;
	border: 1px solid #e7e4d6;
	border-radius: 4px 14px 14px;
}

.assistant__typing span {
	width: 5px;
	height: 5px;
	background: #8a9a7b;
	border-radius: 50%;
	opacity: 0.55;
}

.assistant__form {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	background: var(--color-surface);
	border-top: 1px solid var(--color-line);
}

.assistant__input {
	width: 100%;
	min-width: 0;
	min-height: 42px;
	padding: 9px 14px;
	font-family: var(--font-body);
	font-size: 13px;
	color: var(--color-ink);
	background: var(--color-surface-muted);
	border: 1px solid transparent;
	border-radius: var(--radius-pill);
}

.assistant__input::placeholder {
	color: #8e9786;
}

.assistant__input:focus {
	background: var(--color-surface);
	border-color: #b9c9a9;
	outline: none;
}

.assistant__send {
	display: grid;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	place-items: center;
	color: var(--color-surface);
	background: var(--color-brand);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.assistant__send .icon {
	width: 17px;
	height: 17px;
}

.assistant__send:hover {
	background: var(--color-brand-dark);
}

.assistant__send:disabled {
	opacity: 0.45;
	cursor: wait;
}

.assistant__launcher[aria-expanded="true"] .assistant__launcher-dot {
	display: none;
}

@media (max-width: 700px) {
	.assistant {
		right: 12px;
		bottom: 80px;
	}

	.assistant__panel {
		position: fixed;
		right: 12px;
		bottom: 148px;
		left: 12px;
		width: auto;
		height: min(560px, calc(100dvh - 170px));
	}

	.assistant__launcher {
		width: 54px;
		height: 54px;
	}
}

@media (max-width: 380px) {
	.assistant__panel {
		right: 8px;
		left: 8px;
	}
}
