/* Macrolyx — Community Chat widget. */

.mlx-chat { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }

/* ---------------- Toolbar ---------------- */

.mlx-chat-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 0 0 10px;
}
.mlx-chat-topics { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.mlx-chat-topic { position: relative; }
.mlx-chat-dot {
	position: absolute;
	top: -2px;
	inset-inline-end: -2px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--mlx-accent);
	box-shadow: 0 0 6px rgba(var(--mlx-accent-rgb), .8);
}
.mlx-chat-bell { opacity: .55; }
.mlx-chat-bell.is-on { opacity: 1; color: var(--mlx-accent); }

.mlx-chat-toolbtns { display: flex; gap: 6px; flex: 0 0 auto; }
.mlx-chat-rules-btn[hidden] { display: none; }

.mlx-chat-rulespanel {
	position: absolute;
	inset: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(2px);
	border-radius: 10px;
}
.mlx-chat-rulespanel[hidden] { display: none; }
.mlx-chat-rulespanel-in {
	background: var(--mlx-bg2);
	border: 1px solid var(--mlx-border);
	border-radius: 12px;
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
	width: min(480px, 92%);
	max-height: 86%;
	display: flex;
	flex-direction: column;
}
.mlx-chat-rulespanel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--mlx-border);
	color: var(--mlx-text);
	font-size: 13px;
}
.mlx-chat-rulespanel-x { background: none; border: 0; color: var(--mlx-muted); cursor: pointer; font-size: 13px; }
.mlx-chat-rulespanel-x:hover { color: var(--mlx-text); }
.mlx-chat-rules-body {
	padding: 12px 14px;
	color: var(--mlx-text);
	font-size: 12.5px;
	line-height: 1.7;
	overflow-y: auto;
	scrollbar-width: thin;
}

/* ---------------- Stream ---------------- */

.mlx-chat-list {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 2px 4px 8px 2px;
	scrollbar-width: thin;
}
.mlx-chat-empty { color: var(--mlx-muted); font-size: 13px; text-align: center; margin: auto; }

/* Locked (upgrade) / read-only empty notice filling the message area. */
.mlx-chat-lock {
	margin: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 10px;
	padding: 16px;
	max-width: 300px;
}
.mlx-chat-lock-icon { font-size: 26px; opacity: .8; }
.mlx-chat-lock-text { color: var(--mlx-muted); font-size: 13px; margin: 0; }
.mlx-chat-lock-cta { margin-top: 2px; }
.mlx-chat-older { align-self: center; }

.mlx-chat-msg {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--mlx-border);
	border-radius: 10px;
	padding: 7px 10px 6px;
	max-width: 92%;
	align-self: flex-start;
}
.mlx-chat-msg.is-mine {
	align-self: flex-end;
	background: rgba(var(--mlx-accent-rgb), 0.07);
	border-color: rgba(var(--mlx-accent-rgb), 0.25);
}

.mlx-chat-msg-head {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 11px;
	margin-bottom: 3px;
	position: relative;
}
.mlx-chat-name { color: var(--mlx-text); font-weight: 700; }
.mlx-chat-plan {
	color: var(--mlx-accent);
	border: 1px solid rgba(var(--mlx-accent-rgb), 0.4);
	border-radius: 20px;
	padding: 0 7px;
	font-size: 10px;
	line-height: 15px;
	white-space: nowrap;
}
.mlx-chat-plan.is-admin { color: var(--mlx-short); border-color: rgba(184, 74, 74, 0.55); }
.mlx-chat-time { color: var(--mlx-muted); font-size: 10px; }

.mlx-chat-acts { margin-inline-start: auto; display: none; gap: 2px; }
.mlx-chat-msg:hover .mlx-chat-acts { display: inline-flex; }
.mlx-chat-act {
	background: none;
	border: 0;
	color: var(--mlx-muted);
	cursor: pointer;
	font-size: 12px;
	padding: 0 3px;
	line-height: 1;
}
.mlx-chat-act:hover { color: var(--mlx-text); }

.mlx-chat-quote {
	border-inline-start: 2px solid var(--mlx-accent);
	background: rgba(255, 255, 255, 0.03);
	border-radius: 6px;
	color: var(--mlx-muted);
	font-size: 11px;
	padding: 3px 8px;
	margin: 2px 0 5px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.mlx-chat-body { color: var(--mlx-text); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.mlx-chat-mention { color: var(--mlx-accent); font-weight: 600; }

.mlx-chat-img { display: inline-block; margin-top: 6px; }
.mlx-chat-img img { max-width: 220px; max-height: 160px; border-radius: 8px; border: 1px solid var(--mlx-border); display: block; }

.mlx-chat-reactions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.mlx-chat-reactions:empty { display: none; }
.mlx-chat-react {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--mlx-border);
	border-radius: 20px;
	color: var(--mlx-muted);
	cursor: pointer;
	font-size: 11px;
	padding: 1px 8px;
	line-height: 17px;
}
.mlx-chat-react.is-mine {
	border-color: rgba(var(--mlx-accent-rgb), 0.55);
	color: var(--mlx-text);
	background: rgba(var(--mlx-accent-rgb), 0.12);
}

.mlx-chat-reactpop {
	position: absolute;
	top: 18px;
	inset-inline-end: 0;
	z-index: 30;
	display: flex;
	gap: 2px;
	background: var(--mlx-bg2);
	border: 1px solid var(--mlx-border);
	border-radius: 20px;
	padding: 3px 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.mlx-chat-reactpop button { background: none; border: 0; cursor: pointer; font-size: 15px; padding: 1px 3px; }
.mlx-chat-reactpop button:hover { transform: scale(1.2); }

/* ---------------- Jump pill ---------------- */

.mlx-chat-jump {
	position: absolute;
	bottom: 64px;
	inset-inline-start: 50%;
	transform: translateX(-50%);
	z-index: 25;
	background: var(--mlx-bg2);
	border: 1px solid rgba(var(--mlx-accent-rgb), 0.5);
	border-radius: 20px;
	color: var(--mlx-accent);
	cursor: pointer;
	font-size: 11px;
	padding: 4px 12px;
}

/* ---------------- Reply bar + composer ---------------- */

.mlx-chat-replybar {
	display: flex;
	align-items: center;
	gap: 8px;
	border-inline-start: 2px solid var(--mlx-accent);
	background: rgba(255, 255, 255, 0.03);
	border-radius: 6px;
	color: var(--mlx-muted);
	font-size: 11px;
	padding: 4px 8px;
	margin-bottom: 6px;
	overflow: hidden;
	white-space: nowrap;
}
.mlx-chat-replybar[hidden] { display: none; }
.mlx-chat-replybar-text { overflow: hidden; text-overflow: ellipsis; }
.mlx-chat-replybar-x { background: none; border: 0; color: var(--mlx-muted); cursor: pointer; margin-inline-start: auto; }

.mlx-chat-composer { display: flex; align-items: flex-end; gap: 6px; padding-top: 2px; }
.mlx-chat-tool {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--mlx-border);
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	height: 32px;
	width: 32px;
	line-height: 1;
	flex: 0 0 auto;
}
.mlx-chat-tool:hover { border-color: rgba(var(--mlx-accent-rgb), 0.5); }

.mlx-chat-input-wrap { position: relative; flex: 1; min-width: 0; }
.mlx-chat-input {
	display: block;
	width: 100%;
	min-height: 32px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--mlx-border);
	border-radius: 8px;
	color: var(--mlx-text);
	font: inherit;
	font-size: 13px;
	padding: 6px 10px;
	resize: none;
	max-height: 110px;
	box-sizing: border-box;
	scrollbar-width: thin;
}
.mlx-chat-input:focus { outline: none; border-color: rgba(var(--mlx-accent-rgb), 0.55); }
.mlx-chat-send {
	flex: 0 0 auto;
	height: 32px;
	padding: 0 14px;
	line-height: 30px;
	box-sizing: border-box;
}

.mlx-chat-attach-preview {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 4px;
}
.mlx-chat-attach-preview[hidden] { display: none; }
.mlx-chat-attach-preview img { max-height: 44px; border-radius: 6px; border: 1px solid var(--mlx-border); }
.mlx-chat-attach-x { background: none; border: 0; color: var(--mlx-muted); cursor: pointer; }

.mlx-chat-emojipop,
.mlx-chat-mentionpop {
	position: absolute;
	bottom: calc(100% + 6px);
	inset-inline-start: 0;
	z-index: 30;
	background: var(--mlx-bg2);
	border: 1px solid var(--mlx-border);
	border-radius: 10px;
	padding: 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
	max-height: 180px;
	overflow-y: auto;
	scrollbar-width: thin;
}
.mlx-chat-emojipop[hidden],
.mlx-chat-mentionpop[hidden] { display: none; }

.mlx-chat-emojipop { display: grid; grid-template-columns: repeat(8, 28px); gap: 2px; }
.mlx-chat-emojipop button { background: none; border: 0; cursor: pointer; font-size: 16px; padding: 2px; border-radius: 6px; }
.mlx-chat-emojipop button:hover { background: rgba(255, 255, 255, 0.07); }

.mlx-chat-mentionpop { display: flex; flex-direction: column; min-width: 160px; }
.mlx-chat-mentionpop button {
	background: none;
	border: 0;
	color: var(--mlx-text);
	cursor: pointer;
	font-size: 12px;
	padding: 5px 8px;
	text-align: start;
	border-radius: 6px;
}
.mlx-chat-mentionpop button:hover { background: rgba(var(--mlx-accent-rgb), 0.12); }
