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

.mp-fb-inst-actions {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin-left: auto;
	flex-shrink: 0;
}

.mp-fb-inst-actions .mp-inst-add { margin-left: 0; }

.mp-fb-add,
.mp-fb-info {
	color: #1877f2;
	box-shadow: 0 4px 14px rgba(24, 119, 242, 0.22);
}

.mp-fb-add:hover,
.mp-fb-info:hover {
	background: #e8f1ff;
	color: #0d65d9;
	box-shadow: 0 6px 18px rgba(24, 119, 242, 0.28);
}

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

.multplat-fb-app {
	flex: 1;
	min-height: 0;
	display: flex;
	background: #fff;
	overflow: hidden;
	position: relative;
}

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

.mp-avatar.fb { background: #e8f1ff; color: #1877f2; }

.mp-fb-web {
	display: none;
	flex: 1;
	flex-direction: column;
	background: #f0f2f5;
	min-height: 0;
}

.multplat-fb-app.is-offline .mp-fb-web { display: flex; }
.multplat-fb-app.is-offline .mp-fb-workspace { display: none; }
.multplat-fb-app.is-online .mp-fb-web { display: none; }
.multplat-fb-app.is-online .mp-fb-workspace { display: flex; }

.mp-fb-web-bar {
	height: 140px;
	background: #1877f2;
	flex-shrink: 0;
}

.mp-fb-web-card {
	margin: -88px auto 2rem;
	width: min(920px, calc(100% - 2rem));
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 6px 18px rgba(11, 20, 26, 0.12);
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	padding: 2.2rem 2rem;
}

.mp-fb-web-copy {
	flex: 1 1 320px;
	min-width: 0;
	color: #41525d;
}

.mp-fb-web-copy h2 {
	font-size: 1.45rem;
	font-weight: 500;
	color: #1c1e21;
	margin-bottom: 1rem;
}

.mp-fb-web-copy ol { padding-left: 1.15rem; }
.mp-fb-web-copy li { margin: 0.4rem 0; }
.mp-fb-web-hint { margin: 1rem 0 0.4rem; color: #667781; font-size: 0.86rem; }

.mp-fb-redirect {
	display: block;
	background: #f0f2f5;
	border-radius: 8px;
	padding: 0.55rem 0.7rem;
	font-size: 0.74rem;
	word-break: break-all;
	color: #1c1e21;
}

.mp-fb-web-action {
	flex: 0 1 260px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
}

.mp-fb-login {
	border: 0;
	border-radius: 8px;
	background: #1877f2;
	color: #fff;
	padding: 0.75rem 1.15rem;
	font-weight: 650;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	box-shadow: 0 4px 14px rgba(24, 119, 242, 0.28);
}

.mp-fb-login:hover { filter: brightness(1.05); color: #fff; }
.mp-fb-login i { font-size: 1.35rem; }

.mp-fb-pages { width: 100%; display: flex; flex-direction: column; gap: 0.45rem; }
.mp-fb-pages-empty {
	margin: 0;
	padding: 0.7rem 0.85rem;
	border-radius: 10px;
	background: #fff8e6;
	border: 1px solid #f0d78c;
	color: #5c4b12;
	font-size: 0.88rem;
	line-height: 1.4;
}
.mp-fb-page-btn {
	border: 1px solid #d1d7db;
	background: #fff;
	border-radius: 10px;
	padding: 0.65rem 0.8rem;
	text-align: left;
	font-weight: 600;
	color: #1c1e21;
}

.mp-fb-page-btn:hover { border-color: #1877f2; background: #f5f9ff; }

.mp-fb-workspace {
	display: none;
	flex: 1;
	flex-direction: column;
	min-height: 0;
	background: #fff;
}

.mp-fb-panel {
	display: none;
	flex: 1;
	min-height: 0;
}

.mp-fb-panel.is-active { display: flex; }

.mp-fb-empty {
	margin: auto;
	text-align: center;
	color: #667781;
	max-width: 420px;
	padding: 2rem;
}

.mp-fb-empty i { font-size: 3.2rem; color: #1877f2; }
.mp-fb-empty h4 { margin: 0.7rem 0 0.35rem; color: #1c1e21; }

.mp-fb-panel[data-panel="posts"],
.mp-fb-panel[data-panel="inbox"],
.mp-fb-panel[data-panel="ads"] {
	flex-direction: column;
	overflow: hidden;
	background: #f0f2f5;
}

.mp-fb-feed,
.mp-fb-ads {
	flex: 1;
	align-self: center;
	width: 100%;
	min-height: 0;
	overflow: auto;
	padding: 1rem 1.15rem 2rem;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.9rem;
}

.mp-fb-feed {
	max-width: 680px;
	width: 100%;
	margin: 0 auto;
}

.mp-fb-feed-card {
	flex-shrink: 0;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
	overflow: hidden;
}

.mp-fb-feed-head {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.75rem 0.9rem 0.4rem;
}

.mp-fb-feed-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	background: #e4e6eb;
	flex-shrink: 0;
}

.mp-fb-feed-avatar.is-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #1877f2;
	font-size: 1.4rem;
}

.mp-fb-feed-who {
	min-width: 0;
	flex: 1;
}

.mp-fb-feed-who strong {
	display: block;
	color: #050505;
	font-size: 0.95rem;
	line-height: 1.2;
}

.mp-fb-feed-who span {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	color: #65676b;
	font-size: 0.78rem;
}

.mp-fb-feed-who span i { font-size: 0.85rem; }

.mp-fb-feed-more {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: #65676b;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.35rem;
}

.mp-fb-feed-more:hover { background: #f0f2f5; color: #050505; }

.mp-fb-feed-text {
	margin: 0;
	padding: 0.15rem 0.95rem 0.7rem;
	color: #050505;
	font-size: 0.95rem;
	line-height: 1.45;
	white-space: pre-wrap;
}

.mp-fb-feed-photo {
	background: #000;
}

.mp-fb-feed-photo img {
	display: block;
	width: 100%;
	max-height: 520px;
	object-fit: contain;
}

.mp-fb-feed-stats {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.55rem 0.95rem;
	color: #65676b;
	font-size: 0.86rem;
	border-bottom: 1px solid #ced0d4;
}

.mp-fb-feed-stats span:last-child { margin-left: auto; }

.mp-fb-feed-actions {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	padding: 0.25rem 0.4rem 0.35rem;
}

.mp-fb-feed-actions button {
	border: 0;
	background: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	height: 36px;
	border-radius: 6px;
	color: #65676b;
	font-weight: 650;
	font-size: 0.9rem;
	cursor: pointer;
}

.mp-fb-feed-actions button:hover { background: #f0f2f5; color: #050505; }
.mp-fb-feed-actions button.is-on { color: #1877f2; }
.mp-fb-feed-actions button.is-busy { opacity: 0.55; pointer-events: none; }

.mp-fb-feed-composer {
	display: flex;
	gap: 0.5rem;
	padding: 0 0.75rem 0.75rem;
}

.mp-fb-feed-composer[hidden] { display: none !important; }

.mp-fb-feed-composer input {
	flex: 1;
	border: 1px solid #ccd0d5;
	border-radius: 18px;
	background: #f0f2f5;
	padding: 0.45rem 0.8rem;
	font-size: 0.9rem;
}

.mp-fb-feed-composer input:focus {
	outline: 0;
	border-color: #1877f2;
	background: #fff;
}

.mp-fb-feed-composer button {
	border: 0;
	border-radius: 8px;
	background: #1877f2;
	color: #fff;
	font-weight: 650;
	padding: 0.4rem 0.8rem;
}

.mp-fb-empty p { white-space: pre-wrap; }

.mp-fb-panel[data-panel="inbox"] {
	background: #fff;
}

.mp-fb-chat {
	flex: 1;
	min-height: 0;
	display: flex;
	width: 100%;
	align-self: stretch;
	background: #fff;
}

.mp-fb-inbox {
	width: min(340px, 38%);
	flex: 0 0 min(340px, 38%);
	max-width: none;
	margin: 0;
	gap: 0;
	background: #fff;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
	overflow: auto;
	border-right: 1px solid #e4e6eb;
}

.mp-fb-thread-pane {
	flex: 1;
	min-width: 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
	background: #f0f2f5;
}

.mp-fb-thread-empty {
	margin: auto;
	text-align: center;
	color: #667781;
	max-width: 320px;
	padding: 2rem;
}

.mp-fb-thread-empty i { font-size: 3.2rem; color: #0084ff; }
.mp-fb-thread-empty h4 { margin: 0.6rem 0 0.3rem; color: #050505; }

.mp-fb-thread-box {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.mp-fb-thread-box[hidden] { display: none !important; }

.mp-fb-thread-head {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.65rem 0.85rem;
	background: #fff;
	border-bottom: 1px solid #e4e6eb;
	flex-shrink: 0;
}

.mp-fb-thread-back {
	display: none;
	border: 0;
	background: transparent;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: #050505;
	font-size: 1.3rem;
}

.mp-fb-thread-who strong { display: block; color: #050505; }
.mp-fb-thread-who span { color: #65676b; font-size: 0.78rem; }

.mp-fb-thread-msgs {
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 1rem 1.1rem 1.2rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.mp-fb-bubble {
	max-width: min(78%, 520px);
	padding: 0.45rem 0.65rem 0.3rem;
	border-radius: 12px;
	box-shadow: 0 1px 1px rgba(11, 20, 26, 0.08);
	word-wrap: break-word;
	white-space: pre-wrap;
}

.mp-fb-bubble.in {
	align-self: flex-start;
	background: #fff;
	color: #050505;
	border-bottom-left-radius: 4px;
}

.mp-fb-bubble.out {
	align-self: flex-end;
	background: #0084ff;
	color: #fff;
	border-bottom-right-radius: 4px;
}

.mp-fb-bubble time {
	display: block;
	text-align: right;
	font-size: 0.68rem;
	opacity: 0.72;
	margin-top: 0.2rem;
}

.mp-fb-bubble img {
	display: block;
	max-width: 220px;
	border-radius: 8px;
	margin-bottom: 0.3rem;
}

.mp-fb-thread-send {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 0.65rem 0.65rem;
	background: #fff;
	border-top: 1px solid #e4e6eb;
	flex-shrink: 0;
}

.mp-fb-send-tools {
	display: flex;
	align-items: center;
	gap: 0.1rem;
	flex-shrink: 0;
}

.mp-fb-send-tools button {
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	color: #0084ff;
	font-size: 1.35rem;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 0.72rem;
	letter-spacing: 0.02em;
}

.mp-fb-send-tools button i { font-size: 1.35rem; }
.mp-fb-send-tools button:hover { background: #f0f2f5; }

.mp-fb-send-field {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	background: #f0f2f5;
	border-radius: 20px;
	padding: 0 0.25rem 0 0.75rem;
}

.mp-fb-send-field input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	padding: 0.5rem 0;
	font-size: 0.95rem;
}

.mp-fb-send-field input:focus { outline: 0; }

.mp-fb-send-field button {
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	color: #0084ff;
	border-radius: 50%;
	font-size: 1.25rem;
}

.mp-fb-thread-send > button[type="submit"] {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: #0084ff;
	color: #fff;
	font-size: 1.2rem;
	flex-shrink: 0;
}

.mp-fb-thread-send button.is-busy,
.mp-fb-thread-send button:disabled {
	opacity: 0.7;
	pointer-events: none;
	cursor: wait;
}

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

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

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

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

.mp-fb-rec-bar {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.45rem 0.85rem;
	background: #fff;
	color: #e41e3f;
	font-weight: 650;
	border-top: 1px solid #e4e6eb;
}

.mp-fb-rec-bar[hidden] { display: none !important; }

.mp-fb-rec-bar button {
	margin-left: auto;
	border: 0;
	background: #e41e3f;
	color: #fff;
	border-radius: 8px;
	padding: 0.3rem 0.7rem;
	font-weight: 650;
}

.mp-fb-thread.is-active { background: #f0f2f5; }

.mp-fb-chat.is-open .mp-fb-inbox { }

@media (max-width: 768px) {
	.mp-fb-inbox { width: 100%; flex-basis: 100%; border-right: 0; }
	.mp-fb-thread-pane { display: none; }
	.mp-fb-chat.is-open .mp-fb-inbox { display: none; }
	.mp-fb-chat.is-open .mp-fb-thread-pane { display: flex; }
	.mp-fb-thread-back { display: flex; align-items: center; justify-content: center; }
}

.mp-fb-thread {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
	padding: 0.75rem 0.95rem;
	border: 0;
	background: #fff;
	text-align: left;
	border-bottom: 1px solid #f0f2f5;
	flex-shrink: 0;
	cursor: pointer;
}

.mp-fb-thread:hover { background: #f0f2f5; }

.mp-fb-thread-ava {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	background: #e4e6eb;
	flex-shrink: 0;
}

.mp-fb-thread-ava.is-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #1877f2;
	font-size: 1.5rem;
}

.mp-fb-thread-main { min-width: 0; flex: 1; }

.mp-fb-thread-top {
	display: flex;
	justify-content: space-between;
	gap: 0.6rem;
	align-items: baseline;
}

.mp-fb-thread-top strong {
	color: #050505;
	font-size: 0.95rem;
}

.mp-fb-thread-top time {
	color: #65676b;
	font-size: 0.75rem;
	white-space: nowrap;
}

.mp-fb-thread-main p {
	margin: 0.15rem 0 0;
	color: #65676b;
	font-size: 0.86rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mp-fb-thread.is-unread strong,
.mp-fb-thread.is-unread p { color: #050505; font-weight: 700; }

.mp-fb-thread-badge {
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: #1877f2;
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.mp-fb-ads {
	max-width: 860px;
	width: 100%;
	margin: 0 auto;
}

.mp-fb-ad {
	flex-shrink: 0;
	display: flex;
	gap: 0.9rem;
	background: #fff;
	border-radius: 8px;
	padding: 0.9rem 1rem;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mp-fb-ad img {
	width: 88px;
	height: 88px;
	border-radius: 8px;
	object-fit: cover;
	background: #e4e6eb;
	flex-shrink: 0;
}

.mp-fb-ad-body { min-width: 0; flex: 1; }

.mp-fb-ad-body h4 {
	margin: 0 0 0.25rem;
	color: #050505;
	font-size: 1rem;
}

.mp-fb-ad-body p {
	margin: 0;
	color: #65676b;
	font-size: 0.84rem;
}

.mp-fb-ad-status {
	display: inline-block;
	margin-top: 0.45rem;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	background: #e7f3ff;
	color: #1877f2;
	font-size: 0.72rem;
	font-weight: 700;
}

.mp-fb-ad-status.is-off { background: #f0f2f5; color: #65676b; }
.mp-fb-ad-status.is-on { background: #e7f8ee; color: #31a24c; }

.mp-fb-modal[hidden] { display: none !important; }
.mp-fb-modal {
	position: fixed;
	inset: 0;
	z-index: 80;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mp-fb-modal-back {
	position: absolute;
	inset: 0;
	background: rgba(11, 20, 26, 0.42);
}

.mp-fb-modal-card {
	position: relative;
	width: min(420px, calc(100% - 2rem));
	background: #fff;
	border-radius: 16px;
	padding: 1.4rem 1.3rem 1.2rem;
	box-shadow: 0 16px 40px rgba(11, 20, 26, 0.2);
}

.mp-fb-modal-icon {
	width: 46px;
	height: 46px;
	border-radius: 14px;
	background: #e8f1ff;
	color: #1877f2;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.6rem;
	margin-bottom: 0.7rem;
}

.mp-fb-modal-card h3 { margin: 0 0 0.3rem; font-size: 1.15rem; color: #1c1e21; }
.mp-fb-modal-text { color: #667781; font-size: 0.86rem; margin-bottom: 0.9rem; }

.mp-fb-modal-card label {
	display: block;
	font-size: 0.78rem;
	font-weight: 650;
	color: #54656f;
	margin-bottom: 0.7rem;
}

.mp-fb-modal-card input {
	display: block;
	width: 100%;
	margin-top: 0.28rem;
	border: 1px solid #d1d7db;
	border-radius: 8px;
	padding: 0.55rem 0.7rem;
	font-size: 0.92rem;
}

.mp-fb-modal-card input:focus {
	outline: 0;
	border-color: #1877f2;
	box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.15);
}

.mp-fb-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 0.4rem;
}

.mp-fb-btn {
	border: 0;
	border-radius: 8px;
	background: #1877f2;
	color: #fff;
	padding: 0.5rem 0.95rem;
	font-weight: 650;
}

.mp-fb-btn.ghost {
	background: #f0f2f5;
	color: #1c1e21;
}

.mp-fb-modal.mp-fb-help {
	top: var(--nex-navbar-h, 71px);
	align-items: flex-start;
	padding: 18px 0 20px;
}

.mp-fb-help-card {
	width: min(640px, calc(100% - 2rem));
	max-height: calc(100vh - var(--nex-navbar-h, 71px) - 38px);
	overflow: auto;
	padding-right: 1.15rem;
}

.mp-fb-help-steps {
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
	counter-reset: mp-fb-step;
}

.mp-fb-help-steps li {
	position: relative;
	padding: 0 0 1rem 2.6rem;
	border-left: 2px solid #e7f0ff;
	margin-left: 0.85rem;
}

.mp-fb-help-steps li:last-child {
	padding-bottom: 0.15rem;
	border-left-color: transparent;
}

.mp-fb-help-steps li::before {
	counter-increment: mp-fb-step;
	content: counter(mp-fb-step);
	position: absolute;
	left: -0.85rem;
	top: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #1877f2;
	color: #fff;
	font-size: 0.78rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mp-fb-help-steps strong {
	display: block;
	color: #1c1e21;
	font-size: 0.95rem;
	margin-bottom: 0.25rem;
}

.mp-fb-help-steps p {
	margin: 0 0 0.4rem;
	color: #54656f;
	font-size: 0.86rem;
	line-height: 1.45;
}

.mp-fb-help-steps a { color: #1877f2; font-weight: 650; }
.mp-fb-help-steps code {
	font-size: 0.78rem;
	background: #f0f2f5;
	padding: 0.05rem 0.3rem;
	border-radius: 4px;
}

.mp-fb-help-copy {
	display: flex;
	align-items: stretch;
	gap: 0.4rem;
	margin: 0.35rem 0 0.45rem;
}

.mp-fb-help-copy code {
	flex: 1;
	min-width: 0;
	display: block;
	padding: 0.5rem 0.65rem;
	border-radius: 8px;
	background: #f0f2f5;
	color: #1c1e21;
	font-size: 0.74rem;
	word-break: break-all;
}

.mp-fb-help-copy button {
	border: 0;
	border-radius: 8px;
	background: #e8f1ff;
	color: #1877f2;
	font-weight: 700;
	padding: 0 0.75rem;
	flex-shrink: 0;
}

@media (max-width: 768px) {
	.mp-fb-web-bar { height: 86px; }
	.mp-fb-web-card { margin-top: -48px; padding: 1.3rem 1.1rem; }
}
