.multplat-wa-page {
	--wa-green: #00a884;
	display: flex;
	flex-direction: column;
	height: calc(100vh - var(--nex-navbar-h, 71px));
	min-height: 520px;
	background: #e9edef;
}

.mp-inst-bar {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.7rem 1rem 0.55rem;
	flex-shrink: 0;
}

.mp-inst-cards {
	display: flex;
	align-items: stretch;
	gap: 0.65rem;
	overflow-x: auto;
	flex: 1;
	min-width: 0;
	padding: 0.1rem 0.15rem 0.25rem;
	scrollbar-width: thin;
}

.mp-inst-card {
	position: relative;
	min-width: 176px;
	max-width: 230px;
	border: 1px solid #d1d7db;
	background: #fff;
	border-radius: 14px;
	padding: 0.72rem 2.1rem 0.72rem 0.85rem;
	cursor: pointer;
	text-align: left;
	box-shadow: 0 1px 2px rgba(11, 20, 26, 0.05);
	transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
	flex-shrink: 0;
}

.mp-inst-card:hover {
	border-color: #b0b8bf;
	transform: translateY(-1px);
}

.mp-inst-card.is-active {
	border-color: #00a884;
	box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.18);
}

.mp-inst-card-name {
	display: block;
	font-weight: 650;
	font-size: 0.9rem;
	color: #111b21;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding-right: 0.15rem;
}

.mp-inst-edit {
	position: absolute;
	top: 0.42rem;
	right: 0.42rem;
	width: 26px;
	height: 26px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #98a2b3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.95rem;
	opacity: 0.72;
	transition: background .15s ease, color .15s ease, opacity .15s ease, transform .15s ease;
}

.mp-inst-card:hover .mp-inst-edit,
.mp-inst-card.is-active .mp-inst-edit {
	opacity: 1;
}

.mp-inst-edit:hover {
	background: #ecfdf3;
	color: #027a48;
	transform: scale(1.06);
}

.mp-inst-card-status {
	display: inline-flex;
	align-items: center;
	gap: 0.32rem;
	margin-top: 0.38rem;
	font-size: 0.72rem;
	font-weight: 600;
	color: #667781;
}

.mp-inst-card-status::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #94a3b8;
}

.mp-inst-card.is-on .mp-inst-card-status { color: #027a48; }
.mp-inst-card.is-on .mp-inst-card-status::before { background: #12b76a; }
.mp-inst-card.is-wait .mp-inst-card-status { color: #b54708; }
.mp-inst-card.is-wait .mp-inst-card-status::before { background: #f79009; }

.mp-inst-add {
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #00a884;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.55rem;
	flex-shrink: 0;
	margin-left: auto;
	box-shadow: 0 4px 14px rgba(0, 168, 132, 0.22);
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.mp-inst-add:hover {
	background: #ecfdf3;
	transform: translateY(-1px) scale(1.03);
	box-shadow: 0 6px 18px rgba(0, 168, 132, 0.28);
	color: #027a48;
}

.mp-inst-hint {
	display: none;
	margin: 0 1rem 0.75rem;
	padding: 0.85rem 1rem;
	border-radius: 12px;
	background: #fff;
	color: #667781;
	font-size: 0.88rem;
}

.multplat-wa-page.is-empty .mp-inst-hint,
.multplat-wa-page:not(.has-chat) .mp-inst-hint { display: block; }

.multplat-chat-app {
	--wa-green: #00a884;
	--wa-bg: #efeae2;
	--wa-panel: #fff;
	--wa-out: #d9fdd3;
	--wa-in: #fff;
	--wa-bar: #f0f2f5;
	display: flex;
	height: calc(100vh - var(--nex-navbar-h, 71px));
	min-height: 520px;
	background: #d1d7db;
	overflow: hidden;
	position: relative;
}

.multplat-wa-page .multplat-chat-app {
	flex: 1;
	min-height: 0;
	height: auto;
}

.multplat-chat-app.is-idle {
	display: none;
}

.mp-chat-list,
.mp-chat-thread {
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: var(--wa-panel);
}

.mp-chat-list {
	width: 36%;
	max-width: 420px;
	min-width: 280px;
	border-right: 1px solid #d1d7db;
}

.mp-chat-thread {
	flex: 1;
	position: relative;
}

.mp-chat-head,
.mp-chat-compose {
	background: var(--wa-bar);
	padding: 0.55rem 0.85rem;
	display: flex;
	align-items: center;
	gap: 0.65rem;
	flex-shrink: 0;
}

.mp-chat-head {
	min-height: 68px;
	padding: 0.7rem 1rem;
	border-bottom: 1px solid #e9edef;
	justify-content: space-between;
}

.mp-head-main {
	min-width: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.12rem;
}

.mp-head-title {
	font-weight: 600;
	font-size: 1.02rem;
	line-height: 1.2;
	color: #111b21;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mp-head-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.35rem 0.55rem;
	min-width: 0;
}

.mp-head-phone {
	color: #54656f;
	font-size: 0.78rem;
	letter-spacing: 0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.mp-head-phone:empty { display: none; }

.mp-head-status {
	display: inline-flex;
	align-items: center;
	gap: 0.32rem;
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1;
	color: #667781;
	padding: 0.16rem 0.5rem;
	border-radius: 999px;
	background: #e9edef;
}

.mp-head-status::before {
	content: '';
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.75;
}

.mp-head-status.is-on {
	color: #027a48;
	background: #d1fadf;
}

.mp-head-status.is-wait {
	color: #b54708;
	background: #fef0c7;
}

.mp-head-side {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: center;
	gap: 0.15rem;
	flex-shrink: 0;
}

.mp-head-clock {
	font-size: 0.78rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: #667781;
	line-height: 1.2;
	letter-spacing: 0.02em;
}

.mp-head-clock:empty { display: none; }

.mp-head-actions {
	display: flex;
	align-items: center;
	gap: 0.1rem;
}

.mp-avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #dfe5e7;
	color: #54656f;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	flex-shrink: 0;
}

.mp-avatar.wa { background: #dcfce7; color: #166534; }
.mp-avatar.group { background: #e7f0ff; color: #1d4ed8; }
.mp-tabs {
	display: flex;
	border-bottom: 1px solid #e9edef;
	background: #fff;
	flex-shrink: 0;
}
.mp-tabs button {
	flex: 1;
	border: 0;
	background: transparent;
	padding: 0.7rem 0.4rem;
	font-weight: 600;
	font-size: 0.9rem;
	color: #667781;
	border-bottom: 3px solid transparent;
	position: relative;
	isolation: isolate;
}
.mp-tabs button.is-active {
	color: #008069;
	border-bottom-color: #00a884;
}
@property --mp-tab-ang {
	syntax: '<angle>';
	inherits: false;
	initial-value: 0deg;
}
.mp-tabs button.has-unread {
	color: #047857;
}
.mp-tabs button.has-unread::before {
	content: '';
	position: absolute;
	inset: 5px 12%;
	border-radius: 999px;
	padding: 2px;
	background: conic-gradient(from var(--mp-tab-ang), #4ade80, #00ff9c, transparent 40%, #22c55e, #86efac, #4ade80);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	animation: mp-tab-spin 1.15s linear infinite;
	filter: drop-shadow(0 0 6px rgba(0, 255, 156, 0.8));
	z-index: -1;
	pointer-events: none;
}
@keyframes mp-tab-spin {
	to { --mp-tab-ang: 360deg; }
}
.mp-search {
	flex: 1;
	border: 0;
	background: #fff;
	border-radius: 8px;
	padding: 0.45rem 0.75rem;
	font-size: 0.86rem;
}

.mp-chats {
	flex: 1;
	overflow: auto;
}

.mp-chat-item {
	display: flex;
	gap: 0.7rem;
	padding: 0.7rem 0.9rem;
	cursor: pointer;
	border-bottom: 1px solid #f0f2f5;
}

.mp-chat-item:hover,
.mp-chat-item.active {
	background: #f0f2f5;
}

.mp-chat-item .meta { min-width: 0; flex: 1; }
.mp-chat-item .nome {
	font-weight: 600;
	font-size: 0.95rem;
	color: #111b21;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.75rem;
}
.mp-chat-item .nome > span:first-child {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.mp-chat-item .when {
	flex-shrink: 0;
	font-weight: 500;
	font-size: 0.72rem;
	color: #667781;
	font-variant-numeric: tabular-nums;
}
.mp-chat-item .when.has-unread { color: #00a884; font-weight: 600; }
.mp-chat-item .prev-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.55rem;
	margin-top: 0.12rem;
}
.mp-chat-item .prev {
	color: #667781;
	font-size: 0.82rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
	flex: 1;
}
.mp-badge {
	background: #25d366;
	color: #fff;
	border-radius: 999px;
	font-size: 0.68rem;
	min-width: 18px;
	height: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 5px;
}

.mp-msgs {
	flex: 1;
	overflow: auto;
	overflow-anchor: none;
	background: var(--wa-bg) url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 60L60 0H40L0 40M60 60V40L40 60' fill='%23d6d2ca' fill-opacity='.25'/%3E%3C/svg%3E");
	padding: 1rem 4%;
}

.mp-date-sep {
	clear: both;
	float: none;
	width: 100%;
	display: flex;
	justify-content: center;
	margin: 0.75rem 0 0.55rem;
	pointer-events: none;
}

.mp-date-sep span {
	background: #e1f2fb;
	color: #54656f;
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.2;
	padding: 0.32rem 0.72rem;
	border-radius: 7.5px;
	box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.mp-msgs-loading,
.mp-msgs-empty {
	clear: both;
	text-align: center;
	color: #667781;
	font-size: 0.8rem;
	padding: 0.55rem 0.4rem;
}

.mp-bubble {
	max-width: min(72%, 640px);
	padding: 0.38rem 0.55rem 0.28rem;
	border-radius: 8px;
	margin-bottom: 0.28rem;
	box-shadow: 0 1px 1px rgba(11, 20, 26, 0.08);
	position: relative;
	clear: both;
	word-wrap: break-word;
}

.mp-bubble.in { background: var(--wa-in); float: left; }
.mp-bubble.out { background: var(--wa-out); float: right; }

.mp-bubble .time {
	display: block;
	text-align: right;
	font-size: 0.68rem;
	color: #667781;
	margin-top: 0.15rem;
}

.mp-bubble img.mp-media,
.mp-bubble video.mp-media {
	max-width: 280px;
	max-height: 280px;
	border-radius: 6px;
	display: block;
	cursor: pointer;
}

.mp-media-hold {
	width: 220px;
	min-height: 168px;
	border: 0;
	border-radius: 8px;
	background: linear-gradient(180deg, #cfd4d8, #b9bfc4);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	cursor: pointer;
	color: #111b21;
	padding: 1rem 0.7rem;
}
.mp-bubble.out .mp-media-hold {
	background: linear-gradient(180deg, #b6e2c3, #9ad4ad);
}
.mp-media-hold .mp-dl {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(17, 27, 33, 0.42);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.55rem;
}
.mp-media-hold .mp-dl-text {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.12rem;
}
.mp-media-hold .mp-dl-label {
	font-size: 0.82rem;
	font-weight: 600;
}
.mp-media-hold .mp-dl-meta {
	font-size: 0.72rem;
	color: #3b4a54;
}
.mp-media-hold.is-audio {
	width: 240px;
	min-height: 0;
	flex-direction: row;
	justify-content: flex-start;
	gap: 0.65rem;
	padding: 0.55rem 0.75rem;
}
.mp-media-hold.is-audio .mp-dl {
	width: 40px;
	height: 40px;
	font-size: 1.25rem;
	flex-shrink: 0;
}
.mp-media-hold.is-audio .mp-dl-text {
	align-items: flex-start;
}
.mp-dl-save {
	display: block;
	margin-top: 0.25rem;
	color: #008069;
	font-size: 0.75rem;
	font-weight: 600;
	text-decoration: underline;
}
.mp-dl-spin {
	width: 22px;
	height: 22px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: mp-spin 0.7s linear infinite;
}

.mp-bubble audio { width: 240px; }

.mp-doc {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem 0.2rem;
}

.mp-compose-input {
	flex: 1;
	min-width: 0;
	border: 0;
	border-radius: 8px;
	padding: 0.55rem 0.8rem;
	resize: none;
	max-height: 120px;
	min-height: 42px;
}

.mp-wa-extra {
	display: flex;
	align-items: stretch;
	flex-shrink: 0;
	height: 40px;
	background: #fff;
	border: 1px solid #e9edef;
	border-radius: 999px;
	overflow: hidden;
}

.mp-wa-extra button {
	min-width: 46px;
	padding: 0 0.7rem;
	border: 0;
	border-right: 1px solid #e9edef;
	background: #fff;
	color: #54656f;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.mp-wa-extra button:last-child { border-right: 0; }
.mp-wa-extra button i { font-size: 1.2rem; font-weight: 400; }
.mp-wa-extra button:hover { background: #f0f2f5; color: #111b21; }

.mp-wa-emoji {
	display: flex;
	flex-wrap: wrap;
	gap: 0.2rem;
	padding: 0.55rem 0.7rem;
	background: #fff;
	border-top: 1px solid #e9edef;
	max-height: 160px;
	overflow: auto;
	flex-shrink: 0;
}

.mp-wa-emoji[hidden] { display: none !important; }

.mp-wa-emoji button {
	border: 0;
	background: transparent;
	width: 34px;
	height: 34px;
	font-size: 1.25rem;
	border-radius: 8px;
}

.mp-wa-emoji button:hover { background: #f0f2f5; }

.mp-icon-btn {
	border: 0;
	background: transparent;
	color: #54656f;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.35rem;
}

.mp-icon-btn:hover { background: rgba(11, 20, 26, 0.06); color: #111b21; }
.mp-icon-btn.send { color: #fff; background: var(--wa-green); }
.mp-icon-btn.send:hover { filter: brightness(1.05); color: #fff; }
.mp-icon-btn.send.is-busy,
.mp-icon-btn.send:disabled {
	opacity: 0.7;
	pointer-events: none;
	cursor: wait;
}

.mp-attach-menu {
	position: absolute;
	bottom: 72px;
	left: 18px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(11, 20, 26, 0.18);
	padding: 0.4rem;
	display: none;
	z-index: 5;
}

.mp-attach-menu.show { display: block; }
.mp-attach-menu button {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	width: 100%;
	border: 0;
	background: transparent;
	padding: 0.55rem 0.75rem;
	border-radius: 8px;
	color: #111b21;
}
.mp-attach-menu button:hover { background: #f0f2f5; }

.mp-empty {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	text-align: center;
	color: #667781;
	padding: 2rem;
	background: #f0f2f5;
}

.mp-menu-wrap { position: relative; }
.mp-head-menu {
	display: none;
	position: absolute;
	top: 46px;
	right: 0;
	min-width: 220px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(11, 20, 26, 0.18);
	padding: 0.35rem 0;
	z-index: 12;
}
.mp-head-menu.show { display: block; }
.mp-head-menu button {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	width: 100%;
	border: 0;
	background: transparent;
	padding: 0.65rem 1rem;
	color: #111b21;
	text-align: left;
}
.mp-head-menu button:hover { background: #f0f2f5; }
.mp-head-menu i { font-size: 1.15rem; color: #54656f; }

.mp-wa-web {
	display: none;
	flex: 1;
	flex-direction: column;
	background: #f0f2f5;
	min-height: 0;
	width: 100%;
}
.multplat-chat-app.is-offline .mp-wa-web { display: flex; }
.multplat-chat-app.is-offline .mp-chat-list,
.multplat-chat-app.is-offline .mp-chat-thread { display: none; }

.mp-wa-web-bar {
	height: 140px;
	background: #00a884;
	flex-shrink: 0;
}
.mp-wa-web-card {
	margin: -88px auto 2rem;
	width: min(920px, calc(100% - 2rem));
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 6px 18px rgba(11, 20, 26, 0.12);
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	padding: 2.4rem 2.2rem 2rem;
}
.mp-wa-web-copy {
	flex: 1 1 320px;
	min-width: 0;
	color: #41525d;
}
.mp-wa-web-copy h2 {
	font-size: 1.55rem;
	font-weight: 300;
	color: #41525d;
	margin-bottom: 1.4rem;
}
.mp-wa-web-copy ol {
	padding-left: 1.15rem;
	margin: 0 0 1.4rem;
	line-height: 1.7;
}
.mp-wa-web-copy li { margin-bottom: 0.55rem; }
.mp-wa-web-hint {
	font-size: 0.86rem;
	color: #8696a0;
	margin: 0;
}
.mp-wa-web-qr {
	flex: 0 0 280px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
}
.mp-qr-frame {
	width: 264px;
	height: 264px;
	background: #fff;
	border: 1px solid #e9edef;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.mp-qr-frame img {
	width: 248px;
	height: 248px;
	display: block;
}
.mp-qr-wait {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.7rem;
	color: #667781;
	font-size: 0.88rem;
}
.mp-qr-spin {
	width: 28px;
	height: 28px;
	border: 3px solid #d1d7db;
	border-top-color: #00a884;
	border-radius: 50%;
	animation: mp-spin 0.8s linear infinite;
}
@keyframes mp-spin { to { transform: rotate(360deg); } }
.mp-wa-web-refresh {
	border: 0;
	background: transparent;
	color: #00a884;
	font-weight: 600;
	font-size: 0.88rem;
}
.mp-wa-web-refresh:hover { text-decoration: underline; }

.mp-rec-bar {
	display: none;
	align-items: center;
	gap: 0.6rem;
	flex: 1;
	color: #dc2626;
	font-weight: 600;
}
.mp-rec-bar.show { display: flex; }

.mp-img-view {
	position: fixed;
	inset: 0;
	z-index: 20050;
	background: rgba(6, 8, 10, 0.94);
	display: flex;
	align-items: center;
	justify-content: center;
	touch-action: none;
	overscroll-behavior: contain;
	user-select: none;
}
.mp-img-view img {
	max-width: 96vw;
	max-height: 92vh;
	object-fit: contain;
	transform-origin: center center;
	will-change: transform;
	pointer-events: none;
	border-radius: 4px;
}
.mp-img-view-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 1.7rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}
.mp-img-view-hint {
	position: absolute;
	bottom: 18px;
	left: 0;
	right: 0;
	text-align: center;
	color: rgba(255, 255, 255, 0.72);
	font-size: 0.82rem;
	pointer-events: none;
}

@media (max-width: 768px) {
	.mp-inst-bar { padding: 0.55rem 0.7rem 0.4rem; }
	.mp-inst-card { min-width: 150px; }
	.mp-inst-add { width: 40px; height: 40px; }
	.mp-chat-head { padding: 0.6rem 0.75rem; gap: 0.5rem; }
	.mp-head-title { font-size: 0.96rem; }
	.mp-chat-list { width: 100%; max-width: none; }
	.multplat-chat-app.is-thread .mp-chat-list { display: none; }
	.multplat-chat-app:not(.is-thread) .mp-chat-thread { display: none; }
	.multplat-chat-app.is-offline .mp-wa-web { display: flex; }
	.mp-wa-web-bar { height: 86px; }
	.mp-wa-web-card {
		margin-top: -48px;
		padding: 1.4rem 1.1rem 1.3rem;
		flex-direction: column;
		align-items: center;
	}
	.mp-wa-web-copy h2 { font-size: 1.25rem; }
}
