.comments {
	position: relative;
}

.comment-editor {
	position: sticky;
	bottom: 16px; /* fallback */
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));

	background-color: rgba(231, 240, 240, .8);
	border-radius: 20px;
	padding: 16px;
	z-index: 5;

	backdrop-filter: blur(4px);
}

.comment-editor__label {
	display: block;
}
.comment-editor__reply {
	display: flex;
	align-items: center;
	column-gap: 5px;
	margin-bottom: 4px;
	font-size: .75rem;
}
.comment-editor__reply-name {
	font-weight: 600;
}
.comment-editor__cancel-reply {
	background-color: var(--color-gray);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
	position: relative;
	width: 16px;
	height: 16px;
}
.comment-editor__cancel-reply::before,
.comment-editor__cancel-reply::after {
	background: var(--color-gray-light);
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 50%;
	height: 1px;
}
.comment-editor__cancel-reply::before {
	transform: translate(-50%, -50%) rotate(-45deg);
}
.comment-editor__cancel-reply::after {
	transform: translate(-50%, -50%) rotate(45deg);
}

.comment-editor__input {
	display: block;
	box-sizing: border-box;
	background-color: var(--color-gray-xlight);
	border: none;
	border-radius: 12px;
	font-weight: 500;
	font-size: .875rem;
	line-height: 1.25rem;
	resize: vertical;
	padding: 10px 42px 10px 16px;
	width: 100%;
	min-height: 40px;
}
.comment-editor__input::placeholder {
	color: var(--color-gray);
}
.comment-editor__submit {
	background-color: var(--color-gray-light);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	transition: var(--transition);
	padding: 0;
	position: absolute;
	right: calc(16px + 6px);
	bottom: calc(16px + 6px);
	width: 28px;
	height: 28px;
}
.comment-editor__submit > .ico {
	fill: var(--color-gray);
	transition: var(--transition);
}
.comment-editor__submit:is(:active, :focus-visible, :hover) {
	background-color: var(--color-gray);
}
.comment-editor__submit:is(:active, :focus-visible, :hover) > .ico {
	fill: var(--color-white);
}

.comment-list {
	margin-bottom: 1.5rem;
}

.comment-thread {
	border-bottom: 1px solid var(--color-gray);
	padding-bottom: .75rem;
}
.comment-thread:not(:last-child) {
	margin-bottom: .75rem;
}

.comment-thread__replies:has(.comment) {
	margin-top: .75rem;
	padding-left: 56px;
}

.comment {
	display: flex;
}
.comment + .comment {
	margin-top: .75rem;
}
.comment_deleted .comment__avatar,
.comment_deleted .comment__author,
.comment_deleted .comment__text {
	opacity: .5;
}

.comment_root {}
.comment_reply {}

.comment__avatar {
	margin-right: 12px;
}
.comment__avatar-img {
	border: 1px solid var(--color-gray);
	border-radius: 50%;
	width: 40px;
	height: 40px;
}
.comment__content {
	width: calc(100% - 40px - 1px * 2 - 12px);
}
.comment__author-line {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	column-gap: 10px;
	row-gap: 3px;
}
.comment__author {
	font-weight: 600;
	font-size: 1rem;
	color: var(--color-brown);
}
.comment__date {
	font-weight: 500;
	font-size: .75rem;
	color: var(--color-gray-dark);
	margin-bottom: .25rem;
}
.comment__text {
	font-weight: 500;
	font-size: .875rem;
	color: var(--color-brown);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.comment__reply-target {}

.comment__status {
	--comment-status-color: var(--color-gray-dark);

	display: inline-flex;
	align-items: center;
	column-gap: 5px;

	font-size: .75rem;
	font-weight: 500;
	line-height: 1;
	color: var(--comment-status-color);
}

.comment__status::before {
	content: "";
	display: block;
	flex: 0 0 10px;
	width: 10px;
	height: 10px;

	background-color: currentColor;
	border-radius: 50%;
}
.comment__status_pending {
	--comment-status-color: var(--color-purple);
}
.comment__status_published {
	--comment-status-color: var(--color-green);
}
.comment__status_rejected {
	--comment-status-color: var(--color-yellow);
}
.comment__status_deleted {
	--comment-status-color: var(--color-red);
}

.comment__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	column-gap: 8px;
	row-gap: 6px;
	margin-top: .5rem;
}

.comment__reply-btn {
	background-color: transparent;
	border: none;
	cursor: pointer;
	font-weight: 500;
	font-size: .75rem;
	color: var(--color-gray-dark);
	padding: 0;
}

.comment__moderation {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	column-gap: 5px;
	margin-left: auto;
}

.control {
	background-color: var(--color-white);
	border: none;
	border-radius: 2px;
	box-shadow: inset 0 0 0 1px var(--color-purple);
	cursor: pointer;
	padding: 2px;
	width: 20px;
	height: 20px;
}
.control > .ico {
	width: 80%;
	height: 80%;
}
.control_accept > .ico {
	fill: var(--color-green);
}
.control_reject > .ico {
	fill: var(--color-yellow);
}
.control_delete > .ico {
	fill: var(--color-red);
}