/* Общий контейнер комментов */
.comments__area {
	background: var(--cm-area-bg);
	border-top: 1px solid var(--cm-area-border);
	color: var(--cm-color);
	padding: 0 10px;
	font-weight: normal;
}
/* Отцентрированный контейнер */
.comments__wrapper {
	width: 100%;
	max-width: 800px;
	margin: 0 auto;
	padding-bottom: 30px;
}
/* Шапка блока комментов */
.comments__header {
	color: var(--cm-header-color);
	font-size: 1.125rem;
	font-weight: 500;
	height: 50px;
	padding: 0 5px;
	display: flex;
	align-items: center;
}
/* Счётчик количества комментариев в шапке */
.comments__counter {
	color: var(--cm-counter-color);
	background: var(--cm-counter-bg);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 26px;
	padding: 0 10px;
	margin-left: 15px;
	border-radius: 3px;
	cursor: default;
}

.comments__rules {
	padding: 10px 0;
	font-size: 0.8125rem;
	line-height: 1.3;
}

/* Поле ввода комментария */
.comment__input {
	background: var(--cm-input-bg) no-repeat 50% 50%;
	color: var(--cm-input-color);
	border-radius: 3px;
	border: none;
	height: 35px;
	padding: 10px 15px;
	font-size: 0.9375rem;
	line-height: 20px;
	border: 1px solid #0002;
	font-family: inherit;
}
textarea.comment__input {
	display: block;
	width: 100%;
	resize: vertical;
	height: 120px;
	min-height: 80px;
	max-height: 300px;
}
.comment__input:focus {
	outline: 2px solid var(--cm-input-outline);
}
.comment__buttonset {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-top: 8px;
}

.comment__submit {
	background: var(--cm-button-bg);
	color: var(--cm-button-color);
	height: 34px;
	font-size: 0.875rem;
	font-family: inherit;
	padding: 0 40px;
	/*border: none;*/
	border: 1px solid #0002;
	border-radius: 3px;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s;
}
.comment__submit:hover {
	background: var(--cm-button-bg-hover);
	color: var(--cm-button-color-hover);
}

.comment__checkbox {
	/*color: var(--cm-checkbox-color);*/
	position: relative;
	flex-shrink: 0;
	margin: 0;
	overflow: hidden;
	cursor: pointer;
	display: flex;
	align-items: center;
	font-size: 0.875rem;
	line-height: 1;
	gap: 6px;
}
.comment__checkbox input {
	position: absolute;
	top: -50px;
}
.comment__checkbox i {
	background: var(--cm-checkbox-bg);
	flex-shrink: 0;
	width: 32px;
	height: 18px;
	position: relative;
	border-radius: 20px;
	transition: background 0.3s;
}
.comment__checkbox i:after {
	background: var(--cm-checkbox-handle);
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	top: 1px;
	left: 1px;
	border-radius: 20px;
	transition: left 0.3s;
}
.comment__checkbox input:checked + i {background: var(--cm-checkbox-checked);}
.comment__checkbox input:checked + i:after {
	background: var(--cm-checkbox-checked-handle);
	left: 15px;
}



/* Разметка древовидности */
.comments__tree {
	list-style: none;
	margin: 0;
	padding: 0;
}
.comments__wrapper > .comments__tree {
	margin: 24px 0 0;
}

.comments__tree li {
	margin-top: 4px;
}
.comments__tree .comments__tree {
	padding-left: 22px;
	margin-left: 7px;
	border-left: 1px solid var(--cm-tree-border);
}

.comment {
	padding: 10px 15px;
	background: var(--cm-bg);
	border-radius: 8px;
}
.comment:hover {
	background: var(--cm-bg-hover);
}
.comment.editmode {
	background: var(--cm-edit-bg);
}

.editmode.comment[data-indent="1"] {margin-left: -30px}
.editmode.comment[data-indent="2"] {margin-left: -60px}
.editmode.comment[data-indent="3"] {margin-left: -90px}
.editmode.comment[data-indent="4"] {margin-left: -120px}
.editmode.comment[data-indent="5"] {margin-left: -150px}
.editmode.comment[data-indent="6"] {margin-left: -180px}
.editmode.comment[data-indent="7"] {margin-left: -210px}
.editmode.comment[data-indent="8"] {margin-left: -240px}
.editmode.comment[data-indent="9"] {margin-left: -270px}


.editmode .comment__input {
	height: 200px;
	resize: none;
}
.comment__header {
	display: flex;
	font-size: 0.75rem;
	line-height: 24px;
	font-weight: 400;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.comment__profile {
	color: var(--cm-profile-color);
	font-weight: bold;
	font-size: 0.875rem;
	margin-right: 15px;
	text-overflow: ellipsis;
	overflow: hidden;
}
.comment__profile img {
	float: left;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	margin-right: 12px;
}
.comment__profile .comment__avatar {
	display: inline-block;
	float: left;
	width: 24px;
	height: 24px;
	margin-right: 12px;
	overflow: visible;
	vertical-align: top;
}
.comment__profile .comment__avatar img {
	float: none;
	display: block;
	margin-right: 0;
}
.comment__date {
}
.comment__tip {
	margin-left: auto;
	font-size: 0.6875rem;
	opacity: 0.6;
}
.comment__tip button {
	background-color: transparent;
	border: none;
	color: inherit;
	padding: 0;
	font-size: inherit;
	cursor: pointer;
}
.comment__tip button:hover {
	color: #f90;
	text-shadow: 0 1px 4px #f904;
}

/* Основное тело текста комментария */
.comment__body {
	padding: 10px 0;
	position: relative;
}
/* Текст комментария */
.comment__content {
	color: var(--cm-content-color);
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.6;
	word-break: break-word;
}
.comment__body--spoiler div.comment__content {
	background: var(--cm-spoiler-bg);
	filter: blur(5px);
	opacity: .5;
}
.comment__body--spoiler:after {
	content: 'Spoiler — tap to reveal';
	color: var(--cm-spoiler-color);
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	text-decoration: underline;
	font-size: 0.875rem;
	/*text-shadow: 0 1px 5px #000;*/
	z-index: 3;
	cursor: pointer;
}
.comment__body--spoiler:hover:after {
	color: var(--cm-spoiler-color-hover);
}
.comment__content--lowrate {
	cursor: pointer;
}
.comment__content--lowrate div {
	opacity: 0.5;
	font-size: 0.75rem;
}
.comment__content--lowrate button {
	background: transparent;
	border: none;
	color: inherit;
	padding: 0;
	font-size: 0.875rem;
	text-decoration: underline;
}
.comment__content--lowrate:hover button {
	color: var(--cm-spoiler-color-hover);
}

.comment__controls {
	display: flex;
	position: relative;
}
.comment__controls + .comment__controls {
	margin-top: 10px;
}
.comment__controls > button {
	color: inherit;
	height: 24px;
	min-width: 24px;
	text-align: center;
	border: none;
	padding: 0;
	background: transparent;
	font-size: 0.75rem;
	cursor: pointer;
	transition: color 0.2s;
}
.comment__controls > button + button {
	margin-left: 15px;
}
.comment__controls > button:hover {
	color: #f90;
	text-shadow: 0 1px 4px #f904;
}

.comment__menu {
	position: absolute;
	top: 100%;
	left: 50px;
	background: #333;
	border-radius: 3px;
	padding: 4px 0;
	z-index: 999;
}
.comment__menu button {
	display: block;
	width: 100%;
	background: transparent;
	border: none;
	height: 32px;
	padding: 0 16px;
	color: #ccc;
	text-align: left;
	cursor: pointer;
	font-size: 0.8125rem;
}
.comment__menu button:hover {
	background: #555;
	color: #fff;
}

.comment__rating {
	margin-left: auto;
	display: flex;
	align-items: center;
	font-weight: 500;
	cursor: default;
}
.comment__rating--good {color: #4BAF50}
.comment__rating--bad {color: #DE7072}
.comment__rating button {
	color: var(--cm-rating-button-color);
	background: transparent;
	border: none;
	width: 24px;
	height: 24px;
	cursor: pointer;
	padding: 0;
	margin: 0;
	border-radius: 6px;
	transition: 0.3s;
}
.comment__rating button:hover {
	color: var(--cm-rating-button-color-hover);
	background: #8882;
}
.comment__rating button:disabled {
	display: none;
	/*cursor: default;
	color: #333;
	background: transparent;*/
}
.comment__rating div {
	cursor: pointer;
	width: 40px;
	padding: 0 6px;
	text-align: center;
}




@media (max-width: 699px) {
	.comments__tree .comments__tree {
		padding-left: 12px;
	}
	.comment {
		padding: 10px;
	}
	.editmode.comment[data-indent="1"] {margin-left: -20px}
	.editmode.comment[data-indent="2"] {margin-left: -40px}
	.editmode.comment[data-indent="3"] {margin-left: -60px}
	.editmode.comment[data-indent="4"] {margin-left: -80px}
	.editmode.comment[data-indent="5"] {margin-left: -100px}
	.editmode.comment[data-indent="6"] {margin-left: -120px}
	.editmode.comment[data-indent="7"] {margin-left: -140px}
	.editmode.comment[data-indent="8"] {margin-left: -160px}
	.editmode.comment[data-indent="9"] {margin-left: -180px}

	.comment__controls > button + button {
		margin-left: 12px;
	}
	.comment__submit {
		padding: 0 16px;
	}
}



/* Закрывает страницу пока она не загружена */
body.loading {overflow: hidden}

body.loading::after,
body.loading-ajax::after {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9999;
	background-repeat: no-repeat;
	background-position: 50% 50%;
	background-image: var(--body-loading);
	background-color: var(--body-loading-bg);
}

/* Индикатор AJAX загрузки */
body.loading-ajax::after {
	background-color: var(--body-loading-ajax-bg);
}

.tooltip {
	background-color: var(--tooltop-bg);
	color: var(--tooltop-color);
	position: absolute;
	display: none;
	padding: 5px 8px;
	font-size: 0.8125rem;
	line-height: 1.2;
	font-weight: 400;
	border-radius: 4px;
	box-shadow: 0 2px 8px #0000001a;
}
