.aisaas-widget {
	--aisaas-primary: #2563eb;
	bottom: 20px;
	color: #111827;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	position: fixed;
	right: 20px;
	z-index: 99999;
}

.aisaas-widget [hidden] {
	display: none !important;
}

.aisaas-launcher {
	align-items: center;
	background: var(--aisaas-primary);
	border: 0;
	border-radius: 999px;
	box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
	color: #fff;
	cursor: pointer;
	display: flex;
	font-size: 15px;
	font-weight: 700;
	height: 54px;
	justify-content: center;
	min-width: 74px;
	padding: 0 18px;
}

.aisaas-panel {
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
	display: flex;
	flex-direction: column;
	height: min(650px, calc(100vh - 40px));
	overflow: hidden;
	width: min(420px, calc(100vw - 28px));
}

.aisaas-panel__header {
	align-items: center;
	background: #111827;
	color: #fff;
	display: flex;
	justify-content: space-between;
	padding: 14px;
}

.aisaas-panel__header strong,
.aisaas-panel__header span {
	display: block;
}

.aisaas-panel__header span {
	color: #cbd5e1;
	font-size: 12px;
	margin-top: 2px;
}

.aisaas-window-actions {
	display: flex;
	gap: 6px;
}

.aisaas-close,
.aisaas-minimize {
	align-items: center;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	display: flex;
	font-size: 16px;
	font-weight: 700;
	height: 36px;
	justify-content: center;
	line-height: 1;
	padding: 0;
	width: 36px;
}

.aisaas-messages {
	background: #f8fafc;
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	min-height: 120px;
	overflow-y: auto;
	padding: 14px;
}

.aisaas-message {
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.45;
	max-width: 88%;
	padding: 10px 12px;
	white-space: pre-wrap;
}

.aisaas-message--assistant {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e5e7eb;
}

.aisaas-message--user {
	align-self: flex-end;
	background: var(--aisaas-primary);
	color: #fff;
}

.aisaas-lead-gate {
	background: #fff;
	border-top: 1px solid #e5e7eb;
	padding: 14px;
}

.aisaas-lead-form {
	display: grid;
	gap: 10px;
}

.aisaas-form {
	align-items: flex-end;
	background: #fff;
	border-top: 1px solid #e5e7eb;
	display: flex;
	gap: 10px;
	padding: 12px;
}

.aisaas-form textarea,
.aisaas-lead-form input,
.aisaas-lead-form select {
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	box-sizing: border-box;
	color: #111827;
	font: inherit;
	min-height: 44px;
	padding: 10px;
	width: 100%;
}

.aisaas-form textarea {
	min-height: 54px;
	resize: vertical;
}

.aisaas-form button,
.aisaas-lead-form button {
	background: var(--aisaas-primary);
	border: 0;
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	font-weight: 700;
	min-height: 44px;
	padding: 10px 16px;
}

.aisaas-phone-row {
	display: grid;
	gap: 8px;
	grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
}

.aisaas-verify {
	align-items: center;
	color: #374151;
	display: grid;
	font-size: 13px;
	gap: 6px;
	grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1fr);
}

.aisaas-consent {
	align-items: center;
	color: #374151;
	display: flex;
	font-size: 13px;
	gap: 8px;
}

.aisaas-consent input {
	min-height: auto;
	width: auto;
}

.aisaas-hp {
	left: -10000px;
	position: absolute;
	top: auto;
}

@media (max-width: 480px) {
	.aisaas-widget {
		bottom: 14px;
		right: 14px;
	}

	.aisaas-panel {
		height: calc(100vh - 28px);
		width: calc(100vw - 28px);
	}

	.aisaas-phone-row,
	.aisaas-verify {
		grid-template-columns: 1fr;
	}
}
