.multplat-tt-page,
.mp-tt-modal {
	--tt: #fe2c55;
	--tt-cyan: #25f4ee;
	--tt-ink: #161823;
}

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

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

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

.mp-tt-add,
.mp-tt-info {
	color: var(--tt);
	box-shadow: 0 4px 14px rgba(254, 44, 85, 0.22);
}

.mp-tt-add:hover,
.mp-tt-info:hover {
	background: #ffe8ee;
	color: #d10e3a;
	box-shadow: 0 6px 18px rgba(254, 44, 85, 0.28);
}

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

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

.multplat-tt-app.is-idle { display: none; }
.mp-avatar.tt { background: #161823; color: #fff; }

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

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

.mp-tt-web-bar {
	height: 140px;
	background: linear-gradient(120deg, #25f4ee 0%, #161823 48%, #fe2c55 100%);
	flex-shrink: 0;
}

.mp-tt-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: 1.8rem 1.6rem;
}

.mp-tt-web-copy { flex: 1 1 320px; }
.mp-tt-web-copy h2 { margin: 0 0 0.8rem; font-size: 1.35rem; color: #161823; }
.mp-tt-web-copy ol { margin: 0 0 1rem; padding-left: 1.15rem; color: #4a4a4a; }
.mp-tt-web-copy li { margin-bottom: 0.4rem; }
.mp-tt-web-hint { margin: 0 0 0.4rem; color: #8e8e8e; font-size: 0.82rem; }
.mp-tt-redirect {
	display: block;
	padding: 0.5rem 0.7rem;
	background: #f0f2f5;
	border-radius: 8px;
	font-size: 0.78rem;
	word-break: break-all;
	color: #161823;
}

.mp-tt-web-action {
	flex: 0 0 240px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mp-tt-login {
	border: 0;
	border-radius: 10px;
	background: #161823;
	color: #fff;
	padding: 0.7rem 1.1rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
}

.mp-tt-login:hover { background: #000; }

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

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

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

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

.mp-tt-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-tt-thread:hover,
.mp-tt-thread.is-active { background: #f7f7f7; }
.mp-tt-thread.is-unread strong { font-weight: 700; }

.mp-tt-unread {
	min-width: 1.15rem;
	height: 1.15rem;
	padding: 0 0.3rem;
	border-radius: 999px;
	background: var(--tt);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

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

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

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

.mp-tt-thread-empty,
.mp-tt-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-tt-empty i,
.mp-tt-thread-empty i { font-size: 2.6rem; color: var(--tt); }
.mp-tt-empty h4,
.mp-tt-thread-empty h4 { margin: 0; color: #161823; }

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

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

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

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

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

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

.mp-tt-bubble.in { align-self: flex-start; background: #fff; color: #161823; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.mp-tt-bubble.out { align-self: flex-end; background: #161823; color: #fff; }
.mp-tt-bubble .mp-media-hold { margin-bottom: 0.35rem; }
.mp-tt-bubble.out .mp-media-hold { background: rgba(255,255,255,.12); color: #fff; }
.mp-tt-bubble time { display: block; font-size: 0.68rem; opacity: 0.75; margin-top: 0.25rem; }
.mp-tt-bubble img,
.mp-tt-bubble video { max-width: 220px; border-radius: 10px; display: block; }

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

.mp-tt-attach {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: #f0f2f5;
	color: #161823;
	font-size: 1.2rem;
}

.mp-tt-thread-send input[type="text"] {
	flex: 1;
	border: 1px solid #dbdbdb;
	border-radius: 22px;
	padding: 0.55rem 0.9rem;
}

.mp-tt-thread-send input[type="text"]:focus { outline: 0; border-color: #a8a8a8; }

.mp-tt-thread-send button[type="submit"] {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--tt);
	color: #fff;
	font-size: 1.15rem;
}

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

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

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

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

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

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

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

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

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

.mp-tt-btn.ghost { background: #f0f2f5; color: #161823; }

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

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

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

.mp-tt-help-copy { display: flex; align-items: stretch; gap: 0.4rem; margin: 0.35rem 0 0.45rem; }
.mp-tt-help-copy code {
	flex: 1;
	min-width: 0;
	display: block;
	padding: 0.5rem 0.65rem;
	border-radius: 8px;
	background: #f0f2f5;
	color: #161823;
	font-size: 0.74rem;
	word-break: break-all;
}

.mp-tt-help-copy button {
	border: 0;
	border-radius: 8px;
	background: #ffe8ee;
	color: var(--tt);
	font-weight: 700;
	padding: 0 0.75rem;
}

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