.milan-chat-widget {
	bottom: 22px;
	font-family: Inter, Roboto, Arial, sans-serif;
	position: fixed;
	right: 22px;
	z-index: 9999;
}

.milan-chat-widget * {
	box-sizing: border-box;
}

.milan-chat-widget__launcher {
	align-items: center;
	background: #050505;
	border: 0;
	border-radius: 999px;
	box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
	color: #ffffff;
	cursor: pointer;
	display: none !important;
	gap: 12px;
	min-height: 64px;
	padding: 10px 18px 10px 10px;
}

.milan-chat-widget__launcher-icon,
.milan-chat-widget__avatar {
	align-items: center;
	border-radius: 999px;
	display: inline-flex;
	flex: 0 0 44px;
	height: 44px;
	justify-content: center;
	overflow: hidden;
	width: 44px;
}

.milan-chat-widget__launcher-icon svg,
.milan-chat-widget__avatar svg,
.milan-chat-widget__bot-avatar-img {
	display: block;
	height: 100%;
	object-fit: contain;
	padding: 5px;
	width: 100%;
}

.milan-chat-widget__launcher-text {
	display: grid;
	gap: 2px;
	text-align: left;
}

.milan-chat-widget__launcher-text strong {
	font-size: 0.96rem;
	font-weight: 800;
	line-height: 1.1;
}

.milan-chat-widget__launcher-text small {
	color: rgba(255, 255, 255, 0.72);
	font-size: 0.76rem;
	font-weight: 600;
	line-height: 1.1;
}

.milan-chat-widget__panel {
	background: #ffffff;
	border: 1px solid #dbe3ec;
	border-radius: 28px;
	bottom: 84px;
	box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
	display: flex;
	flex-direction: column;
	max-height: min(760px, calc(100vh - 132px));
	overflow: hidden;
	position: absolute;
	right: 0;
	width: min(420px, calc(100vw - 28px));
}

.milan-chat-widget__panel[hidden] {
	display: none !important;
}

.milan-chat-widget__header {
	align-items: center;
	background: #050505;
	color: #ffffff;
	display: flex;
	justify-content: space-between;
	padding: 18px 18px 16px;
}

.milan-chat-widget__launcher-icon,
.milan-chat-widget__avatar--bot {
	background: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.28);
}

.milan-chat-widget__identity {
	align-items: center;
	display: flex;
	gap: 12px;
}

.milan-chat-widget__identity strong,
.milan-chat-widget__identity span {
	display: block;
}

.milan-chat-widget__identity strong {
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.15;
}

.milan-chat-widget__identity span {
	color: rgba(255, 255, 255, 0.78);
	font-size: 0.78rem;
	line-height: 1.35;
	margin-top: 2px;
	max-width: 220px;
}

.milan-chat-widget__close {
	background: transparent;
	border: 0;
	color: #ffffff;
	cursor: pointer;
	font-size: 1.9rem;
	height: 40px;
	line-height: 1;
	width: 40px;
}

.milan-chat-widget__status {
	background: #ecfdf3;
	border-bottom: 1px solid #c6f6d5;
	color: #0f7a47;
	font-size: 0.78rem;
	font-weight: 700;
	padding: 10px 16px;
}

.milan-chat-widget__messages {
	background:
		linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 12px;
	min-height: 0;
	overflow-y: auto;
	padding: 16px;
}

.milan-chat-widget__typing {
	align-items: center;
	background: #ffffff;
	border-top: 1px solid #e5edf5;
	color: #64748b;
	display: flex;
	font-size: 0.78rem;
	font-weight: 700;
	gap: 8px;
	padding: 10px 16px;
}

.milan-chat-widget__typing[hidden] {
	display: none;
}

.milan-chat-typing-dots {
	align-items: center;
	display: inline-flex;
	gap: 4px;
}

.milan-chat-typing-dots i {
	animation: milan-chat-typing-bounce 1s infinite ease-in-out;
	background: currentColor;
	border-radius: 999px;
	display: block;
	height: 5px;
	opacity: 0.45;
	width: 5px;
}

.milan-chat-typing-dots i:nth-child(2) {
	animation-delay: 0.14s;
}

.milan-chat-typing-dots i:nth-child(3) {
	animation-delay: 0.28s;
}

@keyframes milan-chat-typing-bounce {
	0%,
	80%,
	100% {
		opacity: 0.35;
		transform: translateY(0);
	}

	40% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

.milan-chat-widget__message-body {
	display: grid;
	gap: 6px;
}

.milan-chat-widget__message--guest .milan-chat-widget__message-body {
	justify-items: end;
}

.milan-chat-widget__message-meta {
	align-items: center;
	display: flex;
	gap: 8px;
}

.milan-chat-widget__message--guest .milan-chat-widget__message-meta {
	flex-direction: row-reverse;
}

.milan-chat-widget__message-avatar {
	align-items: center;
	background: #eef2f7;
	border-radius: 999px;
	color: #334155;
	display: inline-flex;
	flex: 0 0 28px;
	font-size: 0.74rem;
	font-weight: 800;
	height: 28px;
	justify-content: center;
	overflow: hidden;
	width: 28px;
}

.milan-chat-widget__message--bot .milan-chat-widget__message-avatar {
	background: #ffffff;
	border: 1px solid #050505;
}

.milan-chat-widget__message-avatar .milan-chat-widget__bot-avatar-img {
	padding: 3px;
}

.milan-chat-widget__message-meta strong {
	color: #64748b;
	font-size: 0.74rem;
	font-weight: 700;
}

.milan-chat-widget__bubble {
	border-radius: 18px;
	max-width: 82%;
	padding: 12px 14px;
}

.milan-chat-widget__message--bot .milan-chat-widget__bubble {
	background: #f1f5f9;
	color: #0f172a;
}

.milan-chat-widget__message--staff .milan-chat-widget__bubble {
	background: #e0f2fe;
	color: #0f172a;
}

.milan-chat-widget__message--guest .milan-chat-widget__bubble {
	background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
	color: #ffffff;
}

.milan-chat-widget__bubble p {
	font-size: 0.92rem;
	line-height: 1.56;
	margin: 0;
	white-space: pre-wrap;
}

.milan-chat-widget__attachments {
	display: grid;
	gap: 8px;
	grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
	margin-top: 10px;
}

.milan-chat-widget__attachment {
	border: 1px solid #dbe3ec;
	border-radius: 12px;
	display: block;
	overflow: hidden;
	text-decoration: none;
}

.milan-chat-widget__attachment img {
	aspect-ratio: 1 / 1;
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.milan-chat-widget__quick {
	border-top: 1px solid #e5edf5;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 14px 16px 10px;
}

.milan-chat-widget__quick[hidden] {
	display: none;
}

.milan-chat-widget__quick button {
	background: #ffffff;
	border: 1px solid #dbe3ec;
	border-radius: 999px;
	color: #334155;
	cursor: pointer;
	font-size: 0.78rem;
	font-weight: 700;
	min-height: 34px;
	padding: 0 12px;
}

.milan-chat-widget__quick button:hover {
	border-color: #94a3b8;
}

.milan-chat-widget__composer {
	border-top: 1px solid #e5edf5;
	flex: 0 0 auto;
	padding: 12px 14px 14px;
}

.milan-chat-widget__previews {
	display: flex;
	gap: 8px;
	margin-bottom: 10px;
	overflow-x: auto;
}

.milan-chat-widget__preview {
	flex: 0 0 68px;
	position: relative;
}

.milan-chat-widget__preview img {
	border-radius: 14px;
	display: block;
	height: 68px;
	object-fit: cover;
	width: 68px;
}

.milan-chat-widget__preview button {
	align-items: center;
	background: rgba(15, 23, 42, 0.9);
	border: 0;
	border-radius: 999px;
	color: #ffffff;
	cursor: pointer;
	display: inline-flex;
	height: 22px;
	justify-content: center;
	position: absolute;
	right: -4px;
	top: -4px;
	width: 22px;
}

.milan-chat-widget__composer-row {
	align-items: center;
	background: #f8fafc;
	border: 1px solid #dbe3ec;
	border-radius: 20px;
	display: grid;
	gap: 8px;
	grid-template-columns: auto minmax(0, 1fr) 44px;
	min-height: 52px;
	padding: 5px;
}

.milan-chat-widget__upload-actions {
	display: flex;
	flex: 0 0 auto;
	gap: 6px;
}

.milan-chat-widget__upload {
	align-items: center;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	color: #0f172a;
	cursor: pointer;
	display: inline-flex;
	font-size: 1rem;
	height: 44px;
	justify-content: center;
	transition: background-color 0.18s ease, border-color 0.18s ease;
	width: 44px;
}

.milan-chat-widget__upload:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
}

.milan-chat-widget__upload span {
	line-height: 1;
}

.milan-chat-widget__upload input {
	display: none;
}

.milan-chat-widget__input {
	background: transparent;
	border: 0;
	border-radius: 14px;
	box-shadow: none;
	color: #0f172a;
	font-family: inherit;
	font-size: 0.92rem;
	line-height: 1.35;
	max-height: 120px;
	min-height: 44px;
	outline: none;
	padding: 12px 8px;
	resize: none;
	width: 100%;
}

.milan-chat-widget__send {
	align-items: center;
	background: #050505;
	border: 0;
	border-radius: 16px;
	color: #ffffff;
	cursor: pointer;
	display: inline-flex;
	height: 44px;
	justify-content: center;
	transition: transform 0.18s ease, background-color 0.18s ease;
	width: 44px;
}

.milan-chat-widget__send:hover {
	background: #1f2937;
	transform: translateY(-1px);
}

.milan-chat-widget__send svg {
	height: 20px;
	width: 20px;
}

@media (min-width: 850px) and (max-height: 760px) {
	.milan-chat-widget__panel {
		bottom: 72px;
		max-height: calc(100vh - 96px);
	}

	.milan-chat-widget__header {
		padding-bottom: 14px;
		padding-top: 14px;
	}

	.milan-chat-widget__quick {
		padding-bottom: 8px;
		padding-top: 10px;
	}
}

@media (max-width: 849px) {
	.milan-chat-widget {
		bottom: 14px;
		left: 14px;
		right: 14px;
	}

	.milan-chat-widget__launcher {
		justify-content: center;
		width: 100%;
	}

	.milan-chat-widget__panel {
		border-radius: 26px 26px 0 0;
		bottom: -14px;
		left: -14px;
		max-height: min(86vh, 780px);
		position: fixed;
		right: -14px;
		top: auto;
		width: auto;
	}

	.milan-chat-widget__messages {
		max-height: none;
		min-height: 44vh;
	}

	.milan-chat-widget__composer {
		padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
	}

	.milan-chat-widget__composer-row {
		gap: 6px;
		grid-template-columns: auto minmax(0, 1fr) 42px;
	}

	.milan-chat-widget__upload-actions {
		gap: 4px;
	}

	.milan-chat-widget__upload,
	.milan-chat-widget__send {
		height: 42px;
		width: 42px;
	}

	.milan-chat-widget__input {
		font-size: 0.88rem;
		min-height: 42px;
		padding-left: 6px;
		padding-right: 6px;
	}

	.milan-chat-widget__bubble {
		max-width: 90%;
	}
}
