.user-poem-comments {
    width: 100%;
    margin: 24px 0 0;
    padding: 24px 0 0;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--border, #e9e9ef);
    border-radius: 0;
    box-shadow: none;
}

.user-poem-comments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.user-poem-comments-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--primary, #e23a3d);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.user-poem-comments h2 {
    margin: 0;
    color: var(--text, #202126);
    font-size: 26px;
    line-height: 1.2;
}

.user-poem-comment-form,
.user-poem-comment-reply-form {
    margin-bottom: 24px;
}

.user-poem-comment-form textarea,
.user-poem-comment-reply-form textarea,
.user-poem-comments-modal textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    padding: 14px 16px;
    color: var(--text, #202126);
    background: var(--surface-solid, #fff);
    border: 1px solid var(--border, #dddfe6);
    border-radius: 14px;
    outline: none;
    font: inherit;
    line-height: 1.55;
}

.user-poem-comment-form textarea:focus,
.user-poem-comment-reply-form textarea:focus,
.user-poem-comments-modal textarea:focus {
    border-color: var(--primary, #e23a3d);
}

.user-poem-comment-form-bottom,
.user-poem-comment-reply-form-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.user-poem-comment-form-bottom span {
    color: var(--text-muted, #81838d);
    font-size: 12px;
}

.user-poem-comments-note,
.user-poem-comment-alert,
.user-poem-comments-empty {
    padding: 14px 16px;
    border: 1px solid var(--border, #e0e1e6);
    border-radius: 14px;
    color: var(--text-muted, #6f727b);
    background: var(--surface, #fafafa);
}

.user-poem-comments-note {
    margin-bottom: 22px;
}

.user-poem-comments-note.is-blocked,
.user-poem-comment-alert.is-error {
    border-color: rgba(226, 58, 61, .25);
    background: rgba(226, 58, 61, .06);
}

.user-poem-comment-alert {
    margin-bottom: 18px;
}

.user-poem-comments-list {
    display: grid;
    gap: 18px;
}

.user-poem-comment {
    display: flex;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border, #e5e6eb);
    border-radius: 18px;
    background: var(--surface-solid, #fff);
}

.user-poem-comment.is-reply {
    margin-top: 12px;
    padding: 14px;
    background: var(--surface, #fafafa);
}

.user-poem-comment-avatar {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
}

.user-poem-comment-avatar img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 50%;
}

.user-poem-comment.is-reply .user-poem-comment-avatar,
.user-poem-comment.is-reply .user-poem-comment-avatar img {
    width: 36px;
    height: 36px;
}

.user-poem-comment-body {
    min-width: 0;
    flex: 1;
}

.user-poem-comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.user-poem-comment-meta a {
    color: var(--text, #202126);
    font-weight: 900;
    text-decoration: none;
}

.user-poem-comment-meta time {
    color: var(--text-muted, #898b94);
    font-size: 12px;
}

.user-poem-comment-author-badge,
.user-poem-comment-blocked-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.user-poem-comment-author-badge {
    color: var(--primary, #e23a3d);
    background: rgba(226, 58, 61, .08);
}

.user-poem-comment-blocked-badge {
    color: #8a5b00;
    background: rgba(236, 178, 50, .14);
}

.user-poem-comment-text {
    color: var(--text, #2d2e33);
    font-size: 15px;
    line-height: 1.65;
    word-break: break-word;
}

.user-poem-comment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.user-poem-comment-actions button,
.user-poem-comment-reply-form button,
.user-poem-comments-modal-actions button {
    padding: 0;
    color: var(--text-muted, #73757e);
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
}

.user-poem-comment-actions button:hover,
.user-poem-comment-reply-form button:hover,
.user-poem-comments-modal-actions button:hover {
    color: var(--primary, #e23a3d);
}

.user-poem-comment-reply-form {
    margin-top: 14px;
    margin-bottom: 0;
}

.user-poem-comment-replies {
    margin-top: 14px;
    padding-left: 14px;
    border-left: 2px solid var(--border, #ececf0);
}

.user-poem-comments-modal[hidden] {
    display: none;
}

.user-poem-comments-modal {
    position: fixed;
    z-index: 99999;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.user-poem-comments-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 16, 22, .58);
}

.user-poem-comments-modal-card {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    padding: 24px;
    color: var(--text, #202126);
    background: var(--surface-solid, #fff);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(0,0,0,.25);
}

.user-poem-comments-modal-card h3 {
    margin: 0 32px 8px 0;
}

.user-poem-comments-modal-card p {
    margin: 0 0 18px;
    color: var(--text-muted, #767983);
    line-height: 1.5;
}

.user-poem-comments-modal-card label {
    display: block;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 900;
}

.user-poem-comments-modal-card label textarea {
    margin-top: 7px;
    font-weight: 400;
}

.user-poem-comments-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--text-muted, #74767d);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 27px;
    line-height: 1;
}

.user-poem-comments-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 20px;
}

body.user-poem-comments-modal-open {
    overflow: hidden;
}

@media (max-width: 680px) {
    .user-poem-comments {
        margin-top: 24px;
        padding: 18px 14px;
        border-radius: 16px;
    }

    .user-poem-comments h2 {
        font-size: 22px;
    }

    .user-poem-comment {
        gap: 10px;
        padding: 14px;
    }

    .user-poem-comment-avatar,
    .user-poem-comment-avatar img {
        width: 38px;
        height: 38px;
    }

    .user-poem-comment-replies {
        padding-left: 8px;
    }

    .user-poem-comment-actions {
        gap: 9px 12px;
    }
}


/* Ветка обсуждения внутри карточки стихотворения */
.user-poem-comment-thread {
    min-width: 0;
}

.user-poem-comment-thread + .user-poem-comment-thread {
    margin-top: 2px;
}

.user-poem-comment-replying-to {
    margin-bottom: 8px;
    color: var(--text-muted, #73757e);
    font-size: 12px;
    font-weight: 700;
}

.user-poem-comment-quote {
    margin: 8px 0 12px;
    padding: 10px 12px;
    color: var(--text-muted, #666a74);
    background: var(--surface, #f7f7f9);
    border-left: 3px solid var(--primary, #e23a3d);
    border-radius: 0 10px 10px 0;
    font-size: 13px;
    line-height: 1.55;
}

.user-poem-comment-replies .user-poem-comment {
    border-radius: 14px;
}

.user-poem-comment-reply-form {
    margin-left: 58px;
    padding-top: 12px;
}

@media (max-width: 680px) {
    .user-poem-comments {
        margin-top: 20px;
        padding: 20px 0 0;
        border-radius: 0;
    }

    .user-poem-comment-reply-form {
        margin-left: 0;
    }
}
