/* ============================================
   INLINE COMMENTS
   ============================================ */
.comment-btn-container {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.comment-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}
.comment-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    background: rgba(99,102,241,0.05);
}
.comment-toggle-btn .comment-count {
    background: var(--primary);
    color: #fff;
    padding: 0.05rem 0.35rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}
.comment-toggle-btn .comment-count.empty {
    background: var(--bg-hover);
    color: var(--text-muted);
}

/* Comment thread under a card */
.comment-thread {
    margin-top: 0.5rem;
    display: none;
}
.comment-thread.visible { display: block; }

.comment-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    align-items: flex-start;
}

.comment-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.65rem; font-weight: 700;
    flex-shrink: 0;
}

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

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.comment-author {
    font-weight: 600;
    color: var(--text-bright);
    font-size: 0.75rem;
}

.comment-date {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.comment-category {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-weight: 600;
}
.comment-category-clarification { background: rgba(59,130,246,0.15); color: var(--info); }
.comment-category-correction { background: rgba(239,68,68,0.15); color: #f87171; }
.comment-category-suggestion { background: rgba(34,197,94,0.15); color: #4ade80; }

.comment-status {
    font-size: 0.6rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-weight: 600;
    margin-left: auto;
}
.comment-status-to-review { background: rgba(234,179,8,0.15); color: #facc15; }
.comment-status-validated { background: rgba(34,197,94,0.15); color: #4ade80; }

.comment-text {
    color: var(--text);
    line-height: 1.5;
    word-wrap: break-word;
}

.comment-actions {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.3rem;
}

.comment-action-btn {
    padding: 0.15rem 0.4rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
}
.comment-action-btn:hover { background: var(--bg-hover); color: var(--text-bright); }

/* Add comment form */
.comment-add-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
    align-items: flex-start;
}

.comment-add-form textarea {
    flex: 1;
    padding: 0.4rem 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.8rem;
    font-family: inherit;
    min-height: 36px;
    resize: vertical;
}
.comment-add-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.comment-add-form select {
    padding: 0.4rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.75rem;
    font-family: inherit;
}

.comment-add-form button {
    padding: 0.4rem 0.7rem;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.comment-add-form button:hover { background: var(--primary-dark); }
