.comments {
    max-width: var(--item-content-width);
    margin: 40px 0;
}

.comments-header {
    margin-bottom: 28px;
    font-size: 150%;
    font-weight: 700;
}

/* Form */

.comment-form {
    padding: 24px;
}

.comment-form-vibes {
    margin-bottom: 20px;
}

.comment-form-vibe {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 2px solid transparent;
    border-radius: var(--input-border-radius);
    box-shadow: var(--input-shadow);
    background-color: var(--block-bg-color);
    font-size: 120%;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.1s ease-out;
}

.comment-form-vibe input[type=radio] {
    width: 20px;
    height: 20px;
    margin: 0;
    flex-shrink: 0;
}

.comment-form-vibe.comment-vibe-good:has(input:checked) {
    border-color: var(--vibe-good-color);
}

.comment-form-vibe.comment-vibe-bad:has(input:checked) {
    border-color: var(--vibe-bad-color);
}

.comment-form-vibe.comment-vibe-neutral:has(input:checked) {
    border-color: var(--text-color);
}

/* Comment */

.comment {
    box-sizing: content-box;
    margin-bottom: 40px;
    padding: 28px 32px;
    color: var(--text-color);
}

.comment.comment-vibe-good {
    background-color: var(--vibe-good-bg);
    color: var(--vibe-good-color);
    font-weight: 500;
}

.comment.comment-vibe-bad {
    background-color: var(--vibe-bad-bg);
    color: var(--vibe-bad-color);
    font-weight: 500;
}

.comment-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-header > .user-badge {
    min-width: 0;
}

.comment-upvote {
    margin-left: auto;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.comment-text {
    overflow-wrap: anywhere;
}

.comment-text-normal {
    font-size: 140%;
    line-height: 1.5;
}

.comment-text-medium {
    font-size: 112%;
    font-weight: 400;
    line-height: 1.45;
}

.comment-text-small {
    font-size: 110%;
    font-weight: 400;
    line-height: 1.42;
}

.comment-footer {
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.comment-actions {
    gap: 14px;
    font-size: 85%;
}

.comment-reply-action {
    flex-shrink: 0;
    margin-left: auto;
}

.comment-date,
.comment-date:visited {
    color: inherit;
    text-decoration: none;
    opacity: 0.6;
}

.comment-date:hover {
    opacity: 1;
}

.comment-action {
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    font-weight: 500;
    opacity: 0.6;
    cursor: pointer;
    text-decoration: none;
}

.comment-action:hover {
    opacity: 1;
}

a.comment-action,
a.comment-action:visited {
    color: inherit;
}

.comment-delete {
    display: inline;
    margin: 0;
}

/* Replies: plain text, no vibe colors */

.comment-replies {
    margin-top: 16px;
    padding-top: 6px;
    border-top: 1px solid var(--separator-color);
}

.reply {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0 0;
    color: var(--text-color);
    font-weight: 400;
}

.reply-body {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.reply-body .user-badge-tiny {
    margin-right: 6px;
    margin-top: -4px;
}

.reply-text,
.reply-text p {
    display: inline;
    margin: 0;
}

.reply-actions {
    flex-shrink: 0;
    font-size: 85%;
}

.comment-reply-form {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.comment-reply-form[hidden] {
    display: none;
}

.comment-reply-form input[type=text] {
    font-size: 100%;
}
