.thread-label-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
        border-radius: 4px;
        color: white;
        margin-right: 4px;
        font-weight: 600;
        display: inline-block;
        vertical-align: middle;
    }

/* Right-Click Context Menu */
.context-menu {
        display: none;
        position: absolute;
        z-index: 1000;
        width: 280px;
        background-color: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        padding: 8px 0;
        font-family: sans-serif;
    }
.context-menu ul { list-style: none; margin: 0; padding: 0; }
.context-menu li {
        padding: 8px 16px;
        cursor: pointer;
        font-size: 0.85rem;
        color: #334155;
        display: flex;
        align-items: center;
        gap: 10px;
    }
.context-menu li:hover { background-color: #f1f5f9; }
.context-divider { height: 1px; background: #e2e8f0; margin: 4px 0; }
    
.context-menu-label-item { display: flex; justify-content: space-between; width: 100%; }

.small-modal-overlay {
    display: none; /* Toggled to 'flex' via JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4); /* Nice dark semi-transparent overlay */
    z-index: 1100; /* Ensure it stays above everything */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px); /* Optional: blurs the background slightly */
}

/* Compact Modal Content Box */
.small-modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 320px; /* Keeps it small and neat */
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    font-family: inherit;
    animation: modalPopIn 0.2s ease-out;
}

@keyframes modalPopIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Modal Title */
.small-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    margin-top: 0;
}

.context-menu-action-icon {
    color: #94a3b8;
    transition: color 0.2s, background 0.2s;
    border-radius: 2px;
}
.context-menu-action-icon:hover {
    color: #1e293b;
    background-color: #e2e8f0;
}



/* Style for the new Download button */
#download-img-btn {
    display: flex; /* set to flex in JS */
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.5);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: background-color 0.2s;
}

#pdf-modal-close {
    display: flex; /* set to flex in JS */
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.5);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: background-color 0.2s;
}

#download-img-btn:hover {
    background: rgba(0,0,0,0.7);
}

.chat-header-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

.chat-header-btn:hover {
    background-color: #f1f5f9;
}

.chat-header-btn:active {
    transform: scale(0.92);
}