.wp-mitra-chat {
	--wp-mitra-panel-bg: #fff;
	--wp-mitra-muted: #64748b;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	z-index: 9999;
}

.wp-mitra-chat.is-theme-dark {
	--wp-mitra-panel-bg: #0f172a;
	--wp-mitra-text: #e5eefb;
	--wp-mitra-muted: #94a3b8;
	--wp-mitra-bot: rgba(148, 163, 184, 0.14);
}

@media (prefers-color-scheme: dark) {
	.wp-mitra-chat.is-theme-auto {
		--wp-mitra-panel-bg: #0f172a;
		--wp-mitra-text: #e5eefb;
		--wp-mitra-muted: #94a3b8;
		--wp-mitra-bot: rgba(148, 163, 184, 0.14);
	}
}

.wp-mitra-chat.position-bottom-right,
.wp-mitra-chat.position-bottom-left,
.wp-mitra-chat.position-center-modal {
	position: fixed;
	bottom: 18px;
}

.wp-mitra-chat.position-bottom-right {
	right: 18px;
}

.wp-mitra-chat.position-bottom-left {
	left: 18px;
}

.wp-mitra-chat.position-center-modal {
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(15, 23, 42, 0.28);
	backdrop-filter: blur(10px);
	pointer-events: none;
}

.wp-mitra-chat.position-center-modal .wp-mitra-launcher {
	position: fixed;
	right: 18px;
	bottom: 18px;
	pointer-events: auto;
}

.wp-mitra-chat.position-center-modal .wp-mitra-panel {
	pointer-events: auto;
}

.wp-mitra-chat[data-inline="1"] {
	position: relative;
	max-width: 420px;
}

.wp-mitra-chat[data-inline="1"] .wp-mitra-launcher,
.wp-mitra-chat[data-inline="1"] .wp-mitra-close {
	display: none;
}

.wp-mitra-chat[data-inline="1"] .wp-mitra-panel {
	display: flex !important;
	position: relative;
	width: 100%;
	height: 480px;
}

.wp-mitra-chat.is-open:not([data-inline="1"]) .wp-mitra-launcher {
	opacity: 0;
	pointer-events: none;
	transform: scale(0.92);
}

.wp-mitra-launcher {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 54px;
	height: 54px;
	padding: 8px 10px 8px 8px;
	border: 0;
	border-radius: 999px;
	background: var(--wp-mitra-primary);
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
	color: #fff;
	cursor: pointer;
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.wp-mitra-launcher-media {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	flex: 0 0 auto;
	overflow: hidden;
}

.wp-mitra-launcher img {
	width: 100%;
	height: 100%;
	border-radius: 999px;
	object-fit: cover;
}

.wp-mitra-launcher-icon {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.wp-mitra-launcher-copy {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	line-height: 1.1;
	text-align: left;
}

.wp-mitra-launcher-copy small {
	display: block;
	font-size: 10px;
	opacity: 0.82;
}

.wp-mitra-launcher-copy strong {
	display: block;
	max-width: 120px;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wp-mitra-panel {
	display: flex;
	flex-direction: column;
	width: min(320px, calc(100vw - 24px));
	height: 460px;
	margin-top: 10px;
	border: 1px solid rgba(148, 163, 184, 0.25);
	border-radius: var(--wp-mitra-radius);
	background: var(--wp-mitra-panel-bg);
	box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
	overflow: hidden;
}

.wp-mitra-panel[hidden] {
	display: none !important;
}

.wp-mitra-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	background: var(--wp-mitra-header);
	color: #fff;
}

.wp-mitra-header-meta {
	display: flex;
	align-items: center;
	gap: 12px;
}

.wp-mitra-header-meta strong,
.wp-mitra-header-meta span {
	display: block;
}

.wp-mitra-header-meta span {
	opacity: 0.76;
	font-size: 12px;
}

.wp-mitra-avatar {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	object-fit: cover;
}

.wp-mitra-header-actions {
	display: flex;
	gap: 6px;
}

.wp-mitra-minimize,
.wp-mitra-close,
.wp-mitra-reset,
.wp-mitra-send {
	border: 0;
	cursor: pointer;
}

.wp-mitra-minimize,
.wp-mitra-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 18px;
	line-height: 1;
}

.wp-mitra-messages {
	flex: 1;
	padding: 14px;
	background: var(--wp-mitra-secondary);
	overflow-y: auto;
}

.wp-mitra-message {
	max-width: 90%;
	margin-bottom: 10px;
	padding: 10px 12px;
	border-radius: calc(var(--wp-mitra-radius) - 6px);
	color: var(--wp-mitra-text);
	line-height: 1.4;
	font-size: 13px;
	word-wrap: break-word;
}

.wp-mitra-message-group {
	max-width: 90%;
	margin-bottom: 12px;
}

.wp-mitra-message.is-user {
	margin-left: auto;
	background: var(--wp-mitra-user);
	color: #fff;
}

.wp-mitra-message.is-bot {
	background: var(--wp-mitra-bot);
}

.wp-mitra-message.is-meta {
	background: transparent;
	color: var(--wp-mitra-muted);
	font-size: 13px;
	padding-left: 0;
	padding-right: 0;
}

.wp-mitra-first-message {
	max-width: 100%;
	font-size: 14px;
}

.wp-mitra-first-message p {
	margin: 0 0 8px;
}

.wp-mitra-first-message-row {
	display: flex;
	gap: 10px;
	align-items: flex-start;
}

.wp-mitra-inline-avatar {
	width: 28px;
	height: 28px;
	border-radius: 10px;
	object-fit: cover;
	flex: 0 0 auto;
}

.wp-mitra-augment {
	margin-top: 6px;
	padding: 8px 10px;
	border-radius: calc(var(--wp-mitra-radius) - 10px);
	font-size: 12px;
	line-height: 1.45;
}

.wp-mitra-augment p:last-child,
.wp-mitra-augment ul:last-child,
.wp-mitra-augment ol:last-child,
.wp-mitra-augment small:last-child {
	margin-bottom: 0;
}

.wp-mitra-followup {
	background: rgba(255, 255, 255, 0.76);
	color: var(--wp-mitra-text);
}

.wp-mitra-disclaimer {
	background: rgba(15, 23, 42, 0.06);
	color: var(--wp-mitra-muted);
	border: 1px solid rgba(148, 163, 184, 0.18);
}

.wp-mitra-custom-html {
	background: linear-gradient(180deg, rgba(21, 94, 239, 0.06), rgba(255, 255, 255, 0.9));
	border: 1px solid rgba(21, 94, 239, 0.12);
}

.wp-mitra-cta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.wp-mitra-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
}

.wp-mitra-cta-primary {
	background: var(--wp-mitra-primary);
	color: #fff;
}

.wp-mitra-cta-secondary {
	background: rgba(15, 23, 42, 0.08);
	color: var(--wp-mitra-text);
}

.wp-mitra-cta-link {
	padding-left: 0;
	padding-right: 0;
	color: var(--wp-mitra-primary);
}

.wp-mitra-footer {
	padding: 10px 12px;
	background: var(--wp-mitra-panel-bg);
	border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.wp-mitra-form {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}

.wp-mitra-input {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid rgba(148, 163, 184, 0.35);
	border-radius: calc(var(--wp-mitra-radius) - 8px);
	background: #fff;
	color: #111827;
	font-size: 13px;
}

.wp-mitra-send {
	padding: 0 14px;
	border-radius: calc(var(--wp-mitra-radius) - 8px);
	background: var(--wp-mitra-primary);
	color: #fff;
	font-weight: 600;
	font-size: 12px;
}

.wp-mitra-reset {
	padding: 0;
	background: transparent;
	color: var(--wp-mitra-muted);
	font-size: 13px;
}

.wp-mitra-reset[disabled] {
	display: none;
}

@media (max-width: 640px) {
	.wp-mitra-chat.position-bottom-right,
	.wp-mitra-chat.position-bottom-left {
		left: 12px;
		right: 12px;
		bottom: 12px;
	}

	.wp-mitra-panel {
		width: 100%;
		height: min(68vh, 460px);
	}

	.wp-mitra-launcher {
		padding-right: 8px;
	}

	.wp-mitra-launcher-copy strong {
		max-width: 92px;
	}
}
