/* Обсуждение главы — social-layer (из discussion-block/, scoped в .lm) */
.lm .soc-card {
	position: relative;
	margin-top: 22px;
	max-width: 100%;
	background: #ffffff;
	border: 1px solid #ecebf3;
	border-radius: 24px;
	box-shadow:
		0 20px 50px -40px rgba(40, 55, 130, .14),
		0 1px 0 rgba(255, 255, 255, .6) inset;
	padding: 26px 32px 22px;
}

.lm .soc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.lm .soc-titlewrap {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.lm .soc-title {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -.01em;
	color: #1b1733;
	display: inline-flex;
	align-items: center;
	gap: 9px;
}

.lm .soc-title .em {
	font-size: 20px;
	line-height: 1;
}

.lm .soc-count {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 12.5px;
	color: #7a7592;
	font-weight: 500;
}

.lm .soc-livedot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #10b981;
	box-shadow: 0 0 0 3px rgba(16, 185, 129, .18);
	animation: socPulse 1.8s ease-in-out infinite;
}

@keyframes socPulse {
	0%, 100% { opacity: 1; }
	50% { opacity: .45; }
}

.lm .soc-sort {
	display: inline-flex;
	gap: 2px;
	background: #f4f3f9;
	border: 1px solid #ecebf3;
	border-radius: 10px;
	padding: 3px;
}

.lm .soc-sort button {
	background: transparent;
	border: none;
	color: #7a7592;
	cursor: pointer;
	font-family: inherit;
	font-weight: 600;
	font-size: 12.5px;
	padding: 6px 12px;
	border-radius: 8px;
	letter-spacing: -.005em;
	transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}

.lm .soc-sort button:hover {
	color: #1b1733;
}

.lm .soc-sort button.is-active {
	background: #fff;
	color: #1b1733;
	box-shadow: 0 1px 2px rgba(40, 30, 80, .07);
}

.lm .soc-hints {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 14px;
}

.lm .soc-hint {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 12px 7px 10px;
	background: #faf9fd;
	border: 1px solid #ecebf3;
	border-radius: 999px;
	font-size: 12.5px;
	color: #5a557a;
	line-height: 1;
}

.lm .soc-hint .em {
	font-size: 14px;
	line-height: 1;
}

.lm .soc-hint b {
	color: #1b1733;
	font-weight: 700;
}

.lm .soc-hint--warn {
	background: #fff8f0;
	border-color: #fde6c8;
	color: #8a4b12;
}

.lm .soc-hint--warn b {
	color: #7c3a0a;
}

.lm .soc-hint--live {
	background: #f0fdf6;
	border-color: #c6f0d9;
	color: #166534;
	cursor: default;
	transition: background .15s ease, border-color .15s ease;
}

.lm .soc-hint--live:hover {
	background: #ecfdf5;
	border-color: #a7e8c4;
}

.lm .soc-hint--live b {
	color: #15803d;
	font-weight: 700;
}

.lm .soc-live-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #10b981;
	flex-shrink: 0;
	box-shadow: 0 0 0 2px rgba(16, 185, 129, .14);
	animation: socLiveDotPulse 2s ease-in-out infinite;
}

@keyframes socLiveDotPulse {
	0%, 100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: .5;
		transform: scale(.9);
	}
}

.lm .soc-list {
	display: flex;
	flex-direction: column;
}

.lm .soc-item {
	position: relative;
	display: grid;
	grid-template-columns: 44px 1fr;
	gap: 12px;
	padding: 11px 12px;
	border-radius: 12px;
	transition: background .18s ease, box-shadow .18s ease;
}

.lm .soc-item + .soc-item {
	margin-top: 2px;
}

.lm .soc-item + .soc-item::before {
	content: "";
	position: absolute;
	left: 12px;
	right: 12px;
	top: -1px;
	height: 1px;
	background: #f3f1f9;
	transition: opacity .18s ease;
}

.lm .soc-item:hover {
	background: #fafaff;
	box-shadow: 0 4px 14px -10px rgba(40, 30, 80, .18);
}

.lm .soc-item:hover::before,
.lm .soc-item:hover + .soc-item::before {
	opacity: 0;
}

.lm .soc-avatar {
	position: relative;
	width: 44px;
	height: 44px;
	display: block;
	flex-shrink: 0;
	align-self: start;
	margin-top: -2px;
}

.lm .soc-avatar img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	filter: drop-shadow(0 1px 2px rgba(40, 30, 80, .10));
	transition: transform .18s ease, filter .18s ease;
}

.lm .soc-item:hover .soc-avatar img {
	transform: translateY(-1px);
	filter: drop-shadow(0 3px 6px rgba(40, 30, 80, .16));
}

.lm .soc-avatar.is-online::after {
	content: "";
	position: absolute;
	right: 1px;
	bottom: 3px;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #10b981;
	box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(16, 185, 129, .22);
}

.lm .soc-item:hover .soc-avatar.is-online::after {
	box-shadow: 0 0 0 2px #fafaff, 0 0 0 3px rgba(16, 185, 129, .22);
}

.lm .soc-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	line-height: 1;
	margin: 2px 0 5px;
}

.lm .soc-name {
	font-weight: 700;
	color: #1b1733;
	letter-spacing: .01em;
	font-size: 12.5px;
	font-feature-settings: "tnum";
}

.lm .soc-dot {
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: #d4d1e0;
}

.lm .soc-time {
	color: #a09bb8;
	font-size: 11.5px;
	font-weight: 500;
}

.lm .soc-text {
	font-size: 14px;
	line-height: 1.45;
	color: #1f1b3e;
	margin: 0 0 7px;
	text-wrap: pretty;
	letter-spacing: -.003em;
}

.lm .soc-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.lm .soc-react {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 3px 9px 3px 7px;
	font-size: 12px;
	font-weight: 600;
	color: #7a7592;
	cursor: pointer;
	font-family: inherit;
	transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
	line-height: 1;
}

.lm .soc-react .em {
	font-size: 13px;
	line-height: 1;
	filter: saturate(.95);
}

.lm .soc-react:hover {
	background: #f4f3f9;
	color: #1b1733;
	transform: translateY(-0.5px);
}

.lm .soc-react.is-mine {
	background: #ede9ff;
	border-color: #ddd3ff;
	color: #4a32c4;
}

.lm .soc-react-add {
	color: #b0acc5;
	opacity: 0;
	transform: translateY(-1px);
	transition: opacity .18s ease, transform .18s ease, background .15s ease, color .15s ease;
}

.lm .soc-item:hover .soc-react-add,
.lm .soc-item:focus-within .soc-react-add {
	opacity: 1;
	transform: translateY(0);
}

.lm .soc-react-add:hover {
	background: #faf9fd;
	color: #5b21b6;
}

.lm .soc-replies {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: none;
	border-radius: 999px;
	padding: 3px 9px;
	font-size: 12px;
	font-weight: 600;
	color: #7a7592;
	cursor: pointer;
	font-family: inherit;
	margin-left: auto;
	transition: color .15s ease, background .15s ease;
}

.lm .soc-replies:hover {
	color: #5b21b6;
	background: #faf9fd;
}

.lm .soc-replies .em {
	font-size: 13px;
}

.lm .soc-list.is-collapsed .soc-item.is-extra {
	display: none;
}

.lm .soc-list:not(.is-collapsed) ~ .soc-foot .soc-more {
	display: none;
}

.lm .soc-foot .soc-more[hidden] {
	display: none !important;
}

.lm .soc-foot {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px dashed #ecebf3;
}

.lm .soc-more {
	flex-shrink: 0;
	background: transparent;
	border: none;
	color: #5a557a;
	border-radius: 10px;
	padding: 8px 4px;
	font-family: inherit;
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	letter-spacing: -.005em;
	transition: color .15s ease;
}

.lm .soc-more:hover {
	color: #5b21b6;
}

.lm .soc-write {
	flex: 1;
	min-width: 200px;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin-left: auto;
	background: #faf9fd;
	color: #7a7592;
	border: 1px solid #ecebf3;
	border-radius: 10px;
	padding: 9px 14px;
	font-family: inherit;
	font-weight: 500;
	font-size: 13px;
	cursor: pointer;
	text-align: left;
	letter-spacing: -.005em;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.lm .soc-write:hover {
	background: #fff;
	border-color: #ddd3ff;
	color: #1b1733;
}

.lm .soc-write svg {
	width: 13px;
	height: 13px;
	fill: #a09bb8;
	flex-shrink: 0;
	transition: fill .15s ease;
}

.lm .soc-write:hover svg {
	fill: #5b21b6;
}

.lm .soc-foot.is-composing .soc-write {
	display: none;
}

.lm .soc-compose {
	width: 100%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-self: stretch;
}

.lm .soc-compose-input {
	width: 100%;
	box-sizing: border-box;
	min-height: 88px;
	resize: vertical;
	border: 1px solid #ecebf3;
	border-radius: 10px;
	padding: 10px 12px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.45;
	color: #1f1b3e;
	background: #fff;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.lm .soc-compose-input:focus {
	outline: none;
	border-color: #ddd3ff;
	box-shadow: 0 0 0 3px rgba(91, 33, 182, .08);
}

.lm .soc-compose-input::placeholder {
	color: #a09bb8;
}

.lm .soc-foot.is-composing {
	flex-direction: column;
	align-items: stretch;
}

.lm .soc-foot.is-composing .soc-more {
	display: none;
}

.lm .soc-compose[hidden] {
	display: none !important;
}

.lm .soc-foot.is-composing .soc-compose {
	display: flex;
	width: 100%;
}

.lm .soc-compose-bar {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	flex-wrap: wrap;
}

.lm .soc-compose-hint {
	flex: 1 1 auto;
	min-width: 0;
	margin-left: auto;
	font-size: 12px;
	color: #a09bb8;
	text-align: right;
}

.lm .soc-compose-send {
	white-space: nowrap;
	flex-shrink: 0;
}

.lm .soc-card button.soc-compose-send {
	background: #5b21b6;
	color: #fff;
	border: 1px solid #5b21b6;
}

.lm .soc-card button.soc-compose-send:hover {
	background: #4c1d95;
	border-color: #4c1d95;
}

.lm .soc-compose-cancel:hover {
	background: #faf9fd;
	color: #1b1733;
}

.lm .soc-compose-cancel,
.lm .soc-compose-send {
	border-radius: 10px;
	padding: 8px 14px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.lm .soc-login-hint {
	flex: 1 1 100%;
	margin: 0;
	padding: 10px 12px;
	font-size: 13px;
	color: #5a557a;
	background: #faf9fd;
	border: 1px solid #ecebf3;
	border-radius: 10px;
}

.lm .soc-login-hint a {
	color: #5b21b6;
	font-weight: 600;
	text-decoration: none;
}

.lm .soc-login-hint a:hover {
	text-decoration: underline;
}

.lm .soc-item.is-user {
	background: #fbfaff;
}

@media (max-width: 640px) {
	.lm .soc-card {
		padding: 20px 16px 18px;
	}

	.lm .soc-head {
		margin-bottom: 14px;
		gap: 12px;
	}

	.lm .soc-title {
		font-size: 18px;
	}

	.lm .soc-item {
		grid-template-columns: 38px 1fr;
		gap: 11px;
		padding: 10px 8px;
	}

	.lm .soc-avatar {
		width: 38px;
		height: 38px;
	}

	.lm .soc-foot.is-composing {
		flex-direction: column;
		align-items: stretch;
	}

	.lm .soc-compose-bar {
		flex-direction: column;
		align-items: flex-start;
	}

	.lm .soc-compose-hint {
		order: -1;
		width: 100%;
		margin-left: 0;
		text-align: left;
	}

	.lm .soc-compose-cancel,
	.lm .soc-compose-send {
		width: auto;
	}

	.lm .soc-foot {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.lm .soc-write {
		width: 100%;
		margin-left: 0;
	}

	.lm .soc-more {
		text-align: center;
		padding: 10px;
	}
}
