.multplat-ig-page,
.mp-ig-modal {
	--ig: #e1306c;
	--ig-dark: #c13584;
}

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

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

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

.mp-ig-add,
.mp-ig-info {
	color: var(--ig);
	box-shadow: 0 4px 14px rgba(225, 48, 108, 0.22);
}

.mp-ig-add:hover,
.mp-ig-info:hover {
	background: #fde8f0;
	color: var(--ig-dark);
	box-shadow: 0 6px 18px rgba(225, 48, 108, 0.28);
}

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

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

.multplat-ig-app.is-idle { display: none; }
.mp-avatar.ig { background: #fde8f0; color: var(--ig); }

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

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

.mp-ig-web-bar {
	height: 140px;
	background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
	flex-shrink: 0;
}

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

.mp-ig-web-copy { flex: 1 1 320px; min-width: 0; color: #41525d; }
.mp-ig-web-copy h2 { font-size: 1.45rem; font-weight: 500; color: #1c1e21; margin-bottom: 1rem; }
.mp-ig-web-copy ol { padding-left: 1.15rem; }
.mp-ig-web-copy li { margin: 0.4rem 0; }
.mp-ig-web-hint { margin: 1rem 0 0.4rem; color: #667781; font-size: 0.86rem; }

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

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

.mp-ig-login {
	border: 0;
	border-radius: 8px;
	background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366);
	color: #fff;
	padding: 0.75rem 1.15rem;
	font-weight: 650;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
}

.mp-ig-login:hover { filter: brightness(1.05); color: #fff; }
.mp-ig-login i { font-size: 1.35rem; }
.mp-ig-login.is-fb {
	background: #1877f2;
	margin-top: 0.45rem;
}
.mp-ig-web-action {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.35rem;
}
.mp-ig-direct-banner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem;
	margin: 0 1rem 0.75rem;
	padding: 0.7rem 0.9rem;
	border-radius: 10px;
	background: #fff4f7;
	border: 1px solid #f5c2d0;
	color: #4a1530;
}
.mp-ig-direct-banner[hidden] { display: none; }
.mp-ig-direct-banner p { margin: 0; font-size: 0.88rem; }
.mp-ig-direct-banner button {
	border: 0;
	border-radius: 8px;
	background: linear-gradient(45deg, #f09433, #dc2743);
	color: #fff;
	padding: 0.45rem 0.75rem;
	font-weight: 650;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.mp-ig-accounts { width: 100%; display: flex; flex-direction: column; gap: 0.45rem; }
.mp-ig-accounts-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-ig-account-btn {
	border: 1px solid #dbdbdb;
	background: #fff;
	border-radius: 10px;
	padding: 0.65rem 0.8rem;
	text-align: left;
	display: flex;
	align-items: center;
	gap: 0.65rem;
}

.mp-ig-account-btn:hover { background: #fafafa; }
.mp-ig-account-btn img,
.mp-ig-account-btn .is-fallback {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	background: #fde8f0;
	color: var(--ig);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.mp-ig-account-btn strong { display: block; color: #1c1e21; }
.mp-ig-account-btn span { display: block; color: #8e8e8e; font-size: 0.78rem; }

.mp-ig-workspace {
	display: none;
	flex: 1;
	min-height: 0;
	flex-direction: column;
}

.mp-ig-panel { display: none; flex: 1; min-height: 0; }
.mp-ig-panel.is-active { display: flex; flex-direction: column; }

.mp-ig-chat {
	flex: 1;
	min-height: 0;
	display: flex;
}

.mp-ig-inbox {
	width: 320px;
	border-right: 1px solid #efefef;
	overflow: auto;
	flex-shrink: 0;
	background: #fff;
}

.mp-ig-thread {
	width: 100%;
	border: 0;
	background: #fff;
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.75rem 0.9rem;
	text-align: left;
	border-bottom: 1px solid #fafafa;
}

.mp-ig-thread:hover,
.mp-ig-thread.is-active { background: #fafafa; }
.mp-ig-thread.is-unread strong { font-weight: 700; }
.mp-ig-unread {
	min-width: 1.15rem;
	height: 1.15rem;
	padding: 0 0.3rem;
	border-radius: 999px;
	background: #e1306c;
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.mp-ig-thread-ava,
.mp-ig-thread-ava.is-fallback {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	background: #fde8f0;
	color: var(--ig);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.mp-ig-thread-main { min-width: 0; flex: 1; }
.mp-ig-thread-top { display: flex; justify-content: space-between; gap: 0.4rem; }
.mp-ig-thread-top strong { color: #262626; font-size: 0.92rem; }
.mp-ig-thread-top time { color: #8e8e8e; font-size: 0.72rem; }
.mp-ig-thread-main p {
	margin: 0.15rem 0 0;
	color: #8e8e8e;
	font-size: 0.82rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mp-ig-thread-pane {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: #fff;
}

.mp-ig-thread-empty,
.mp-ig-empty {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: #8e8e8e;
	padding: 2rem;
	gap: 0.4rem;
}

.mp-ig-empty i,
.mp-ig-thread-empty i { font-size: 2.6rem; color: var(--ig); }
.mp-ig-empty h4,
.mp-ig-thread-empty h4 { margin: 0; color: #262626; }

.mp-ig-thread-box { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mp-ig-chat.is-open .mp-ig-thread-empty { display: none; }

.mp-ig-thread-head {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.7rem 1rem;
	border-bottom: 1px solid #efefef;
}

.mp-ig-thread-back {
	border: 0;
	background: transparent;
	color: #262626;
	font-size: 1.3rem;
	display: none;
}

.mp-ig-thread-who strong { display: block; color: #262626; }
.mp-ig-thread-who span { color: #8e8e8e; font-size: 0.75rem; }

.mp-ig-thread-msgs {
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	background: #fafafa;
}

.mp-ig-bubble {
	max-width: 78%;
	padding: 0.55rem 0.75rem;
	border-radius: 18px;
	font-size: 0.92rem;
	line-height: 1.4;
}

.mp-ig-bubble.in { align-self: flex-start; background: #efefef; color: #262626; }
.mp-ig-bubble.out { align-self: flex-end; background: #3797f0; color: #fff; }
.mp-ig-bubble time { display: block; font-size: 0.68rem; opacity: 0.75; margin-top: 0.25rem; }
.mp-ig-bubble img { max-width: 220px; border-radius: 10px; display: block; }

.mp-ig-thread-send {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.7rem 0.85rem;
	border-top: 1px solid #efefef;
}

.mp-ig-thread-send input {
	flex: 1;
	border: 1px solid #dbdbdb;
	border-radius: 22px;
	padding: 0.55rem 0.9rem;
}

.mp-ig-thread-send input:focus { outline: 0; border-color: #a8a8a8; }

.mp-ig-thread-send button {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--ig);
	color: #fff;
	font-size: 1.15rem;
}

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

.mp-ig-feed {
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 1rem;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 0.7rem;
	align-content: start;
	background: #fafafa;
}

.mp-ig-feed .mp-ig-empty { grid-column: 1 / -1; }

.mp-ig-feed-card {
	background: #fff;
	border: 1px solid #efefef;
	border-radius: 10px;
	overflow: hidden;
}

.mp-ig-feed-photo {
	aspect-ratio: 1;
	background: #f0f0f0;
	overflow: hidden;
}

.mp-ig-feed-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-ig-feed-card p {
	margin: 0;
	padding: 0.55rem 0.7rem 0.7rem;
	font-size: 0.82rem;
	color: #262626;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mp-ig-feed-card time { display: block; padding: 0 0.7rem 0.55rem; color: #8e8e8e; font-size: 0.72rem; }

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

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

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

.mp-ig-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-ig-help-card {
	width: min(640px, calc(100% - 2rem));
	max-height: calc(100vh - var(--nex-navbar-h, 71px) - 38px);
	overflow: auto;
}

.mp-ig-modal-icon {
	width: 46px;
	height: 46px;
	border-radius: 14px;
	background: #fde8f0;
	color: var(--ig);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.6rem;
	margin-bottom: 0.7rem;
}

.mp-ig-modal-card h3 { margin: 0 0 0.3rem; font-size: 1.15rem; color: #1c1e21; }
.mp-ig-modal-text { color: #667781; font-size: 0.86rem; margin-bottom: 0.9rem; }
.mp-ig-modal-card label { display: block; font-size: 0.78rem; font-weight: 650; color: #54656f; margin-bottom: 0.7rem; }
.mp-ig-modal-card input {
	display: block;
	width: 100%;
	margin-top: 0.28rem;
	border: 1px solid #d1d7db;
	border-radius: 8px;
	padding: 0.55rem 0.7rem;
}

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

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

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

.mp-ig-help-steps { margin: 0 0 1rem; padding: 0; list-style: none; counter-reset: mp-ig-step; }
.mp-ig-help-steps li {
	position: relative;
	padding: 0 0 1rem 2.6rem;
	border-left: 2px solid #fde8f0;
	margin-left: 0.85rem;
}

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

.mp-ig-help-steps strong { display: block; color: #1c1e21; font-size: 0.95rem; margin-bottom: 0.25rem; }
.mp-ig-help-steps p { margin: 0 0 0.4rem; color: #54656f; font-size: 0.86rem; line-height: 1.45; }
.mp-ig-help-steps a { color: var(--ig); font-weight: 650; }
.mp-ig-help-steps code { font-size: 0.78rem; background: #f0f2f5; padding: 0.05rem 0.3rem; border-radius: 4px; }

.mp-ig-help-copy { display: flex; align-items: stretch; gap: 0.4rem; margin: 0.35rem 0 0.45rem; }
.mp-ig-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-ig-help-copy button {
	border: 0;
	border-radius: 8px;
	background: #fde8f0;
	color: var(--ig);
	font-weight: 700;
	padding: 0 0.75rem;
}

@media (max-width: 768px) {
	.mp-ig-inbox { width: 100%; }
	.mp-ig-chat.is-open .mp-ig-inbox { display: none; }
	.mp-ig-thread-back { display: inline-flex; }
	.mp-ig-web-bar { height: 86px; }
	.mp-ig-web-card { margin-top: -48px; padding: 1.3rem 1.1rem; }
}
